# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
153857 | RobertDobra | Karte (COCI15_karte) | C++14 | 2 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <string.h>
using namespace std;
char c[1010];
int n,i,p[15],k[15],h[15],t[15],ok,aux;
void verif(int a[15],char X){
if (c[i]==X){
a[aux]++;
a[0]--;
if (a[aux]>1)
ok=0;
}
}
int main(){
cin>>c;
n=strlen(c);
ok=1;
p[0]=k[0]=h[0]=t[0]=13;
for (i=0;i<n && ok;i+=3){
aux=(c[i+1]-'0')*10+c[i+2]-'0';
verif(p,'P');
verif(k,'K');
verif(h,'H');
verif(t,'T');
}
if (ok)
cout<<p[0]<<" "<<k[0]<<" "<<h[0]<<" "<<t[0];
else
cout<<"GRESKA";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |