# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
156125 | mdn2002 | Karte (COCI15_karte) | C++14 | 2 ms | 380 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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[1][x]=true;
}
if(s[i]=='H')
{
if(an[2][x]==true)
{
cout<<"GRESKA";
return 0;
}
ans[2]++;
an[2][x]=true;
}
if(s[i]=='T')
{
if(an[3][x]==true)
{
cout<<"GRESKA";
return 0;
}
ans[3]++;
an[3][x]=true;
}
}
for(int i=0;i<4;i++)cout<<13-ans[i]<<' ';
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |