# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
554994 | MilosMilutinovic | Karte (COCI15_karte) | C++14 | 1 ms | 340 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;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
int n = s.size();
map<char, set<int>> mp;
for (int i = 0; i < n; i += 3) {
mp[s[i]].insert((int) (s[i + 1] - '0') * 10 + (int) (s[i + 2] - '0'));
}
vector<int> ans;
for (auto ch : {'P', 'K', 'H', 'T'}) {
ans.push_back(13 - mp[ch].size());
}
int tot = 0;
for (int i = 0; i < 4; i++) {
tot += 13 - ans[i];
}
if (tot != n / 3) {
cout << "GRESKA" << '\n';
return 0;
}
for (int i = 0; i < 4; i++) {
if (i > 0) {
cout << " ";
}
cout << ans[i];
}
cout << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |