# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
919517 | 2024-02-01T04:08:49 Z | TIN | Karte (COCI15_karte) | C++17 | 1 ms | 708 KB |
#include <bits/stdc++.h> using namespace std; #define FNAME "test" #define ERR "GRESKA" string s; bool b[4][13]; void Task() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cout << fixed << setprecision(9); if (fopen(FNAME".inp","r")) { freopen(FNAME".inp","r",stdin); freopen(FNAME".out","w",stdout); } } void Solve() { //Your Code auto id = [&](char t) -> int { if (t == 'P') return 0; if (t == 'K') return 1; if (t == 'H') return 2; return 3; }; memset(b, false, sizeof(b)); cin >> s; for (int i = 0; i < (int) s.size(); i += 3) { char t = s[i]; int type = id(t); int num = 10 * (s[i + 1] - '0') + (s[i + 2] - '0'); num--; if (b[type][num]) { cout << ERR; return; } b[type][num] = true; } for (int type = 0; type < 4; type++) { int res = 13; for (int num = 0; num < 13; num++) { res -= b[type][num]; } cout << res << " "; } } int main() { Task(); Solve(); cerr << "\nTime run: " << 1000*clock()/CLOCKS_PER_SEC << "ms"; return 37^37; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 0 ms | 344 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 708 KB | Output is correct |
9 | Correct | 1 ms | 348 KB | Output is correct |
10 | Correct | 1 ms | 344 KB | Output is correct |