# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153857 | RobertDobra | Karte (COCI15_karte) | C++14 | 2 ms | 376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |