Submission #554994

#TimeUsernameProblemLanguageResultExecution timeMemory
554994MilosMilutinovicKarte (COCI15_karte)C++14
50 / 50
1 ms340 KiB
#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 timeMemoryGrader output
Fetching results...