Submission #153857

#TimeUsernameProblemLanguageResultExecution timeMemory
153857RobertDobraKarte (COCI15_karte)C++14
50 / 50
2 ms376 KiB
#include <iostream> #include <string.h> using namespace std; char c[1010]; int n,i,p[15],k[15],h[15],t[15],ok,aux; void verif(int a[15],char X){ if (c[i]==X){ a[aux]++; a[0]--; if (a[aux]>1) ok=0; } } int main(){ cin>>c; n=strlen(c); ok=1; p[0]=k[0]=h[0]=t[0]=13; for (i=0;i<n && ok;i+=3){ aux=(c[i+1]-'0')*10+c[i+2]-'0'; verif(p,'P'); verif(k,'K'); verif(h,'H'); verif(t,'T'); } if (ok) cout<<p[0]<<" "<<k[0]<<" "<<h[0]<<" "<<t[0]; else cout<<"GRESKA"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...