Submission #163863

#TimeUsernameProblemLanguageResultExecution timeMemory
163863beso123Karte (COCI15_karte)C++14
50 / 50
2 ms384 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...