#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ar array
#define vo vector
#define pb push_back
#define all(x) begin(x), end(x)
#define sz(x) (ll)(x).size()
#define rep(i, a, b) for(ll i=(a); i<(b); i++)
#define repd(i, a, b) for(ll i=(a); i>=(b); i--)
int main() {
cin.tie(0)->sync_with_stdio(0);
string s;
cin >> s;
unordered_map<char, int> mp;
mp['P']=0, mp['K']=1, mp['H']=2, mp['T']=3;
vo<vo<int>> suite(4, vo<int>(14));
rep(i, 0, sz(s)-2)
suite[mp[s[i]]][10*(s[i+1]-'0')+s[i+2]-'0']++, i+=2;
vo<int> ans;
rep(i, 0, 4) {
int cnt=0;
rep(j, 1, 14)
if(suite[i][j]>1) {
cout << "GRESKA";
return 0;
}
else if(!suite[i][j])
cnt++;
ans.pb(cnt);
}
for(auto i: ans)
cout << i << ' ';
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
320 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
312 KB |
Output is correct |