# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
554994 | MilosMilutinovic | Karte (COCI15_karte) | C++14 | 1 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |