// source problem :
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define int long long
#define lb lower_bound
#define ub upper_bound
#define MASK(i) (1LL << (i))
const int inf = 1e18;
void ckmax(int& f, int s)
{
f = (f > s ? f : s);
}
void ckmin(int& f, int s)
{
f = (f < s ? f : s);
}
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
map<char,set<string>> mp;
map<char, int> cnt;
string s;
cin >> s;
for (int i = 0; i < s.size(); i += 3)
{
string t = s.substr(i + 1, 2);
if (mp[s[i]].count(t))
{
cout << "GRESKA";
return 0;
}
mp[s[i]].insert(t);
cnt[s[i]]++;
}
string t = "PKHT";
for (char c : t) cout << 13 - cnt[c] << ' ';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |