#include <iostream>
#include <cstring>
using namespace std;
char s[1100], x;
int n, i, nr, a[200][20];
int main()
{
/// P K H T
cin>>s;
for ( i=0; s[i]; i+=3 ){
x = s[i];
nr = (s[i+1]-'0')*10+(s[i+2]-'0');
if ( a[x-'A'][nr] != 0 ){
cout<<"GRESKA"; return 0;
}
a[x-'A'][nr] = 1; a[x-'A'][0]++;
}
cout<<13-a['P'-'A'][0]<<" "<<13-a['K'-'A'][0]<<" "<<13-a['H'-'A'][0]<<" "<<13-a['T'-'A'][0];
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
256 KB |
Output is correct |
4 |
Correct |
2 ms |
376 KB |
Output is correct |
5 |
Correct |
2 ms |
256 KB |
Output is correct |
6 |
Correct |
2 ms |
376 KB |
Output is correct |
7 |
Correct |
2 ms |
376 KB |
Output is correct |
8 |
Correct |
2 ms |
376 KB |
Output is correct |
9 |
Correct |
2 ms |
256 KB |
Output is correct |
10 |
Correct |
2 ms |
376 KB |
Output is correct |