# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
153860 | Liviu_Moanta | Karte (COCI15_karte) | C++14 | 2 ms | 424 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<iostream>
using namespace std;
char s[1005];
int n,i;
int v[1005];
int p[15],h[15],k[15],t[15];
int solp,solh,solk,solt;
int main(){
cin>>s;
i=0;
while(s[i]!=0){
v[i]=(int)(s[i]-'0');
i++;
}
n=i;
for(i=0;i<n;i+=3){
if(s[i]=='P'){
if(p[10*v[i+1]+v[i+2]]!=0){
cout<<"GRESKA";
return 0;
}
else{
p[10*v[i+1]+v[i+2]]=1;
solp++;
}
}
if(s[i]=='K'){
if(k[10*v[i+1]+v[i+2]]!=0){
cout<<"GRESKA";
return 0;
}
else{
k[10*v[i+1]+v[i+2]]=1;
solk++;
}
}
if(s[i]=='H'){
if(h[10*v[i+1]+v[i+2]]!=0){
cout<<"GRESKA";
return 0;
}
else{
h[10*v[i+1]+v[i+2]]=1;
solh++;
}
}
if(s[i]=='T'){
if(t[10*v[i+1]+v[i+2]]!=0){
cout<<"GRESKA";
return 0;
}
else{
t[10*v[i+1]+v[i+2]]=1;
solt++;
}
}
}
cout<<13-solp<<" "<<13-solk<<" "<<13-solh<<" "<<13-solt;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |