# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
462597 | JasperL | Karte (COCI15_karte) | C++14 | 1 ms | 204 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |