# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
153866 | 2019-09-17T05:49:29 Z | nicolaalexandra | Karte (COCI15_karte) | C++14 | 2 ms | 376 KB |
#include <iostream> #include <cstring> using namespace std; int f[5][20],sol[5]; char s[1010]; int n,i,j; int main (){ cin>>s+1; n = strlen (s+1); for (i=1;i<=n;i+=3){ int nr = (s[i+1]-'0')*10+s[i+2]-'0'; if (s[i] == 'P') f[0][nr]++; if (s[i] == 'K') f[1][nr]++; if (s[i] == 'H') f[2][nr]++; if (s[i] == 'T') f[3][nr]++; } for (i=0;i<=3;i++){ int nr = 0; for (j=1;j<=13;j++){ if (f[i][j] > 1){ cout<<"GRESKA"; return 0; } nr += f[i][j]; } sol[i] = 13-nr; } cout<<sol[0]<<" "<<sol[1]<<" "<<sol[2]<<" "<<sol[3]; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 252 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 256 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |