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