# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153851 | radugheo | Karte (COCI15_karte) | C++14 | 2 ms | 396 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 <bits/stdc++.h>
using namespace std;
char s[1005];
int l, i, nr, v[5], f1[15], f2[15], f3[15], f4[15];
int main(){
cin >> s;
l = strlen(s);
for (i=0; i<l; i++){
if (i%3 == 0){
nr = (s[i+1] - '0')*10 + s[i+2] - '0';
if (s[i] == 'P'){
v[1]++;
f1[nr]++;
}
if (s[i] == 'K'){
v[2]++;
f2[nr]++;
}
if (s[i] == 'H'){
v[3]++;
f3[nr]++;
}
if (s[i] == 'T'){
v[4]++;
f4[nr]++;
}
}
}
for (i=0; i<=13; i++){
if (f1[i] > 1){
cout << "GRESKA";
return 0;
}
if (f2[i] > 1){
cout << "GRESKA";
return 0;
}
if (f3[i] > 1){
cout << "GRESKA";
return 0;
}
if (f4[i] > 1){
cout << "GRESKA";
return 0;
}
}
cout << 13 - v[1] << " " << 13 - v[2] << " " << 13 - v[3] << " " << 13 - v[4];
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |