# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
154269 | mihaican | 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;
int p=13,k=13,h=13,t=13,pv[15],kv[15],hv[15],tv[15],nr;
char s[1010],c1,c2,x;
int main(){
cin>>s;
for(int i=0;i<strlen(s);i+=3){
x=s[i];
c1=s[i+1];
c2=s[i+2];
nr=(c1-'0')*10+c2-'0';
if(x=='P'){
pv[nr]++;
p--;
}
if(x=='K'){
kv[nr]++;
k--;
}
if(x=='H'){
hv[nr]++;
h--;
}
if(x=='T'){
tv[nr]++;
t--;
}
if(pv[nr]>1||hv[nr]>1||hv[nr]>1||tv[nr]>1){
cout<<"GRESKA";
return 0;
}
}
cout<<p<<" "<<k<<" "<<h<<" "<<t;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |