# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
154213 | KCSC | Karte (COCI15_karte) | C++14 | 3 ms | 376 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(void) {
//freopen("karte.in", "r", stdin);
//freopen("karte.out", "w", stdout);
string str;
cin >> str;
map<char, vector<int>> lst;
for (int i = 0; i < str.length(); i += 3) {
char ch = str[i];
int nr = (str[i + 1] - '0') * 10 + (str[i + 2] - '0');
lst[ch].push_back(nr);
}
vector<int> ans;
for (char ch : {'P', 'K', 'H', 'T'}) {
sort(lst[ch].begin(), lst[ch].end());
for (int i = 0; i + 1 < lst[ch].size(); ++i) {
if (lst[ch][i] == lst[ch][i + 1]) {
cout << "GRESKA\n";
return 0;
}
}
ans.push_back(13 - lst[ch].size());
}
for (int x : ans)
cout << x << " ";
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |