# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
376747 | marat0210 | Karte (COCI15_karte) | C++14 | 1 ms | 364 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;
int main()
{
string s;
cin >>s;
set <string> st;
long long cnt = 0;
for (int i = 0; i < s.size(); i += 3) {
string k = s.substr(i, 3);
st.insert(k);
cnt++;
}
if (st.size() == cnt) {
long long p = 0, f = 0, h = 0, t = 0;
for (int i = 0; i < s.size(); i += 3) {
string k = s.substr(i, 3);
if (k[0] == 'P') p++;
else if (k[0] == 'K') f++;
else if (k[0] == 'H') h++;
else if (k[0] == 'T') t++;
}
cout <<13 - p<<" "<<13 - f<<" "<<13 - h<<" "<<13 - t<<endl;
}
else {
cout <<"GRESKA"<<endl;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |