# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
541985 | 2022-03-25T00:39:14 Z | Olympia | Karte (COCI15_karte) | C++17 | 1 ms | 324 KB |
#include <vector> #include <algorithm> #include <iostream> #include <set> #include <cmath> #include <map> #include <random> #include <cassert> #include <ctime> #include <cstdlib> #include <limits.h> #include <queue> using namespace std; int main() { //freopen("inp.txt", "r", stdin); ios_base::sync_with_stdio(false); cin.tie(NULL); string s; cin >> s; map<int,set<char>> cnt; int ans = 0; for (int i = 0; i < s.length(); i += 3) { if (s[i] == 'P') { cnt[0].insert(s[i + 2]); } else if (s[i] == 'K') { cnt[1].insert(s[i + 2]); } else if (s[i] == 'H') { cnt[2].insert(s[i + 2]); } else if (s[i] == 'T') { cnt[3].insert(s[i + 2]); } } ans = 0; for (int i = 0; i < 4; i++) { //cout << 13 - cnt[i].size() << ' '; ans += cnt[i].size(); } if (ans != s.length()/3) { cout << "GRESKA\n"; return 0; } for (int i = 0; i < 4; i++) { cout << 13 - cnt[i].size() << ' '; // ans += cnt[i].size(); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Incorrect | 0 ms | 212 KB | Output isn't correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Incorrect | 0 ms | 324 KB | Output isn't correct |
5 | Incorrect | 1 ms | 324 KB | Output isn't correct |
6 | Incorrect | 1 ms | 324 KB | Output isn't correct |
7 | Incorrect | 1 ms | 212 KB | Output isn't correct |
8 | Incorrect | 1 ms | 212 KB | Output isn't correct |
9 | Incorrect | 1 ms | 212 KB | Output isn't correct |
10 | Correct | 0 ms | 212 KB | Output is correct |