#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#define INF 1e9
typedef long long ll;
using namespace std;
void solve()
{
string s; cin >> s;
map<string, int>seen;
map<char, int>count;
string ans = "PKHT";
for (int i = 0; i < s.size() - 2; i+=3) {
string x;
x.push_back(s[i]);
x.push_back(s[i + 1]);
x.push_back(s[i + 2]);
if (seen[x]) { cout << "GRESKA" << "\n"; return; }
seen[x]++;
count[x[0]]++;
}
for (int i = 0; i < ans.size(); i++) {
cout << 13 - count[ans[i]] << " ";
}
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int t = 1;// cin >> t;
while (t--) solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |