# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
167368 | 44442 | Karte (COCI15_karte) | C++11 | 2 ms | 380 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;
int a,x;
bool ok;
multiset<int>m[6];
int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin>>s;
m[1].insert(14);
m[2].insert(14);
m[3].insert(14);
m[4].insert(14);
multiset<int>::iterator it;
for(int i=0;i<s.size();i=i+3){
if(s[i]=='P'){
x=1;
}
else if(s[i]=='K'){
x=2;
}
else if(s[i]=='H'){
x=3;
}
else{
x=4;
}
a=10*((int)s[i+1]-48)+(int)s[i+2]-48;
it=m[x].lower_bound(a);
if(*it==a){
ok=1;
break;
}
m[x].insert(a);
}
if(ok){
cout<<"GRESKA";
}
else{
for(int i=1;i<5;i++){
cout<<13-m[i].size()+1<<" ";
}
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |