# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
646121 | Adominator | Karte (COCI15_karte) | C++17 | 1 ms | 320 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 << ' ';
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |