# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
156124 | mdn2002 | Karte (COCI15_karte) | C++14 | 2 ms | 376 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;
long long mod=1e9+7;
int ans[5];
bool an[5][15];
int main()
{
string s;
cin>>s;
for(int i=0;i<s.size();i+=3)
{
int x;
x=((s[i+1]-'0')*10)+(s[i+2]-'0');
if(s[i]=='P')
{
if(an[0][x]==true)
{
cout<<"GRESKA";
return 0;
}
ans[0]++;
an[0][x]=true;
}
if(s[i]=='K')
{
if(an[1][x]==true)
{
cout<<"GRESKA";
return 0;
}
ans[1]++;
an[0][x]=true;
}
if(s[i]=='H')
{
if(an[2][x]==true)
{
cout<<"GRESKA";
return 0;
}
ans[2]++;
an[0][x]=true;
}
if(s[i]=='T')
{
if(an[3][x]==true)
{
cout<<"GRESKA";
return 0;
}
ans[3]++;
an[0][x]=true;
}
}
for(int i=0;i<4;i++)cout<<13-ans[i]<<' ';
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |