Submission #462597

#TimeUsernameProblemLanguageResultExecution timeMemory
462597JasperLKarte (COCI15_karte)C++14
50 / 50
1 ms204 KiB
#include <iostream> using namespace std; int suit(char c) { if (c == 'P') return 0; if (c == 'K') return 1; if (c == 'H') return 2; return 3; } int num(string s) { int ret = 0; for (char z : s) { ret *= 10; ret += (z-'0'); } return ret; } bool seen[4][13]; int ans[4]; int main() { string s; cin >> s; int n = s.length(); for (int i = 0; i < n; i += 3) { int st = suit(s[i]); int m = num(s.substr(i+1,2)); m--; if (seen[st][m]) { cout << "GRESKA" << endl; return 0; } seen[st][m] = true; } for (int i = 0; i < 4; i++) { ans[i] = 13; for (int j = 0; j < 13; j++) { ans[i] -= seen[i][j]; } } for (int i = 0; i < 4; i++) { cout << ans[i] << " "; } cout << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...