#include <iostream>
using namespace std;
int i,n,ok,x,nr,d,y,j,k,v[1001];
short fr[200][30];
int sum[200];
string s;
int main(){
cin>>s;
for(i=0;s[i]!=0;i+=3){
nr=(s[i+1]-48)*10+ s[i+2]-48;
fr[s[i]][nr]++;
if(fr[s[i]][nr]>1){
cout<<"GRESKA";
return 0;
}
sum[s[i]]++;
}
cout<<13-sum['P']<<" "<<13-sum['K']<<" "<<13-sum['H']<<" "<<13-sum['T'];
}
Compilation message
karte.cpp: In function 'int main()':
karte.cpp:11:12: warning: array subscript has type 'char' [-Wchar-subscripts]
11 | fr[s[i]][nr]++;
| ^
karte.cpp:12:15: warning: array subscript has type 'char' [-Wchar-subscripts]
12 | if(fr[s[i]][nr]>1){
| ^
karte.cpp:16:13: warning: array subscript has type 'char' [-Wchar-subscripts]
16 | sum[s[i]]++;
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
344 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |