# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153866 | nicolaalexandra | 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 <cstring>
using namespace std;
int f[5][20],sol[5];
char s[1010];
int n,i,j;
int main (){
cin>>s+1;
n = strlen (s+1);
for (i=1;i<=n;i+=3){
int nr = (s[i+1]-'0')*10+s[i+2]-'0';
if (s[i] == 'P')
f[0][nr]++;
if (s[i] == 'K')
f[1][nr]++;
if (s[i] == 'H')
f[2][nr]++;
if (s[i] == 'T')
f[3][nr]++;
}
for (i=0;i<=3;i++){
int nr = 0;
for (j=1;j<=13;j++){
if (f[i][j] > 1){
cout<<"GRESKA";
return 0;
}
nr += f[i][j];
}
sol[i] = 13-nr;
}
cout<<sol[0]<<" "<<sol[1]<<" "<<sol[2]<<" "<<sol[3];
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |