Submission #156120

#TimeUsernameProblemLanguageResultExecution timeMemory
156120mdn2002Karte (COCI15_karte)C++14
10 / 50
2 ms376 KiB
#include<bits/stdc++.h> using namespace std; long long mod=1e9+7; int ans[5]; bool an[5][15]; int main() { string s; cin>>s; for(int i=0;i<s.size();i+=3) { int x; x=((s[i+1]-'0')*10)+(s[i+2]-'0'); if(s[i]=='P') { if(an[0][x]==true) { cout<<"GRESKA"; return 0; } ans[0]++; an[0][x]=true; } if(s[i]=='K') { if(an[0][x]==true) { cout<<"GRESKA"; return 0; } ans[1]++; an[0][x]=true; } if(s[i]=='H') { if(an[0][x]==true) { cout<<"GRESKA"; return 0; } ans[2]++; an[0][x]=true; } if(s[i]=='T') { if(an[0][x]==true) { cout<<"GRESKA"; return 0; } ans[3]++; an[0][x]=true; } } for(int i=0;i<4;i++)cout<<13-ans[i]<<' '; }

Compilation message (stderr)

karte.cpp: In function 'int main()':
karte.cpp:10:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<s.size();i+=3)
                 ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...