#include <bits/stdc++.h>
using namespace std;
string s;
set<pair<char , string> > st;
map <char , int >mp;
int main()
{
cin>>s;
int n=s.size();
char c;
string t;
for(int i=0;i<n;i+=3)
{
c=s[i];
t="";
t.push_back(s[i+1]);
t.push_back(s[i+2]);
if(st.find({c,t})!=st.end())
{
cout<<"GRESKA"<<endl;
return 0;
}
st.insert({c,t});
mp[c]++;
}
cout<<13-mp['P']<<' '<<13-mp['K']<<' '<<13-mp['H']<<' '<<13-mp['T']<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
248 KB |
Output is correct |
2 |
Correct |
1 ms |
356 KB |
Output is correct |
3 |
Correct |
2 ms |
464 KB |
Output is correct |
4 |
Correct |
1 ms |
572 KB |
Output is correct |
5 |
Correct |
1 ms |
680 KB |
Output is correct |
6 |
Correct |
1 ms |
680 KB |
Output is correct |
7 |
Correct |
1 ms |
704 KB |
Output is correct |
8 |
Correct |
1 ms |
704 KB |
Output is correct |
9 |
Correct |
1 ms |
704 KB |
Output is correct |
10 |
Correct |
1 ms |
704 KB |
Output is correct |