Submission #153849

#TimeUsernameProblemLanguageResultExecution timeMemory
153849AldeaDanutKarte (COCI15_karte)C++14
50 / 50
2 ms376 KiB
#include <iostream> using namespace std; char s[1010],x,y; int v[5][15],i,j,n; int main(){ cin.get(s,1001); while(s[j]!=0){ i=(s[j+1]-'0')*10+(s[j+2]-'0'); if(s[j]=='P'){ if(v[1][i]==1){ cout<<"GRESKA"; return 0; } v[1][0]++; v[1][i]=1; } if(s[j]=='K'){ if(v[2][i]==1){ cout<<"GRESKA"; return 0; } v[2][0]++; v[2][i]=1; } if(s[j]=='H'){ if(v[3][i]==1){ cout<<"GRESKA"; return 0; } v[3][0]++; v[3][i]=1; } if(s[j]=='T'){ if(v[4][i]==1){ cout<<"GRESKA"; return 0; } v[4][0]++; v[4][i]=1; } j+=3; } cout<<13-v[1][0]<<" "<<13-v[2][0]<<" "<<13-v[3][0]<<" "<<13-v[4][0]; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...