Submission #163863

# Submission time Handle Problem Language Result Execution time Memory
163863 2019-11-15T18:31:55 Z beso123 Karte (COCI15_karte) C++14
50 / 50
2 ms 384 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;
string s;
map <string,int> mp;
map <char,int> ch;
main(){
cin>>s;
for(int k=0;k<s.size();k+=3){
    string a;
    a+=s[k];
    a+=s[k+1];
    a+=s[k+2];
    if(mp[a]==1){
        cout<<"GRESKA";
        return 0;
    }
    mp[a]=1;
    ch[a[0]]++;
}
cout<<13-ch['P']<<' '<<13-ch['K']<<' '<<13-ch['H']<<' '<<13-ch['T'];
return 0;
}

Compilation message

karte.cpp:7:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
karte.cpp: In function 'int main()':
karte.cpp:9:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 for(int k=0;k<s.size();k+=3){
             ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 292 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 380 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 2 ms 256 KB Output is correct
10 Correct 2 ms 256 KB Output is correct