Submission #167368

#TimeUsernameProblemLanguageResultExecution timeMemory
16736844442Karte (COCI15_karte)C++11
50 / 50
2 ms380 KiB
#include <bits/stdc++.h> using namespace std; string s; int a,x; bool ok; multiset<int>m[6]; int main (){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>s; m[1].insert(14); m[2].insert(14); m[3].insert(14); m[4].insert(14); multiset<int>::iterator it; for(int i=0;i<s.size();i=i+3){ if(s[i]=='P'){ x=1; } else if(s[i]=='K'){ x=2; } else if(s[i]=='H'){ x=3; } else{ x=4; } a=10*((int)s[i+1]-48)+(int)s[i+2]-48; it=m[x].lower_bound(a); if(*it==a){ ok=1; break; } m[x].insert(a); } if(ok){ cout<<"GRESKA"; } else{ for(int i=1;i<5;i++){ cout<<13-m[i].size()+1<<" "; } } return 0; }

Compilation message (stderr)

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