# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
104655 | MatesV13 | Karte (COCI15_karte) | C++11 | 3 ms | 384 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;
string s; char a, b, c;
int d;
set<int> n[100];
int main (){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> s;
for (int i=0;i<s.size();i+=3){
a=s[i];
b=s[i+1];
c=s[i+2];
d=0;
if (b=='1') d=10;
for (char i = '0';i<='9';i++) if (c==i) d += (int)i - (int)'0';
n[a].insert(d);
}
if (n['P'].size() + n['K'].size() + n['H'].size() + n['T'].size() != (s.size()/3)) cout << "GRESKA";
else cout << 13 - n['P'].size() << " " << 13 - n['K'].size() << " " << 13 - n['H'].size() << " " << 13 - n['T'].size();
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |