# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
704692 | 2023-03-02T15:57:46 Z | delrey | Karte (COCI15_karte) | C++14 | 1 ms | 296 KB |
#include <bits/stdc++.h> using namespace std; bool k[4][20]; int kn[4] = {13, 13, 13, 13}; int main() { string s; cin>>s; int n = s.length(); for(int i = 0; i < n; i += 3) { int num = (s[i + 1] - '0') * 10 + (s[i + 2] - '0'), suit; if(s[i] == 'P') suit = 0; if(s[i] == 'K') suit = 1; if(s[i] == 'H') suit = 2; if(s[i] == 'T') suit = 3; if(k[suit][num]) { cout<<"GRESKA"<<endl; return 0; } k[suit][num] = true; kn[suit]--; } for(int i = 0; i < 4; i++) cout<<kn[i]<<" "; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Correct | 0 ms | 212 KB | Output is correct |
6 | Correct | 1 ms | 212 KB | Output is correct |
7 | Correct | 0 ms | 212 KB | Output is correct |
8 | Correct | 0 ms | 212 KB | Output is correct |
9 | Correct | 0 ms | 212 KB | Output is correct |
10 | Correct | 0 ms | 296 KB | Output is correct |