#include <bits/stdc++.h>
using namespace std;
int main()
{
string s ;
cin>>s ;
map< pair<char ,int> , int>mp ;
map<char , int>ans ;
for(int i = 0 ; i < s.size() ; ++i)
{
if(s[i] >= '0' && s[i] <= '9')
continue;
int num = 0 ;
for(int j = i+1 ; j <= i+2 ; ++j)
num = num * 10 + (s[j]-'0') ;
if(mp[{s[i] , num}] == 0)
mp[{s[i] , num}] = 1 , ans[s[i]]++;
else
return cout<<"GRESKA\n" , 0 ;
}
return cout<<13 - ans['P']<<" "<<13 - ans['K']<<" "<<13 - ans['H']<<" "<<13 - ans['T']<<"\n" , 0 ;
}
Compilation message
karte.cpp: In function 'int main()':
karte.cpp:11:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0 ; i < s.size() ; ++i)
~~^~~~~~~~~~
# |
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 |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
376 KB |
Output is correct |
5 |
Correct |
2 ms |
380 KB |
Output is correct |
6 |
Correct |
2 ms |
256 KB |
Output is correct |
7 |
Correct |
2 ms |
256 KB |
Output is correct |
8 |
Correct |
2 ms |
256 KB |
Output is correct |
9 |
Correct |
2 ms |
256 KB |
Output is correct |
10 |
Correct |
2 ms |
256 KB |
Output is correct |