# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
977211 | lemma_holla | Karte (COCI15_karte) | C++17 | 1 ms | 504 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()
{
ios::sync_with_stdio(false);
vector<string> p, k, h, t;
string s;
cin >> s;
string x;
int f = 0;
for (int i = 0; i < s.size(); i += 3){
x = s.substr(i + 1, 2);
if (s[i] == 'P'){
if (count(p.begin(), p.end(), x) > 0){
cout << "GRESKA";
f = 1;
break;
}
else{
p.push_back(x);
}
}
else if (s[i] == 'H'){
if (count(h.begin(), h.end(), x) > 0){
cout << "GRESKA";
f = 1;
break;
} else{
h.push_back(x);
}
}
else if (s[i] == 'K'){
if (count(k.begin(), k.end(), x) > 0){
cout << "GRESKA";
f = 1;
break;
} else{
k.push_back(x);
}
}
else if (s[i] == 'T'){
if (count(t.begin(), t.end(), x) > 0){
cout << "GRESKA";
f = 1;
break;
} else{
t.push_back(x);
}
}
}
if (f == 0){
cout << 13 - p.size() << " " << 13 - k.size() << " " << 13 - h.size() << " " << 13 - t.size();
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |