답안 #153879

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
153879 2019-09-17T07:53:23 Z mihnea_anghel Karte (COCI15_karte) C++17
50 / 50
2 ms 376 KB
#include <iostream>
#include <cstring>

using namespace std;
char s[1100], x;
int n, i, nr, a[200][20];

int main()
{
    /// P K H T
    cin>>s;
    for ( i=0; s[i]; i+=3 ){
        x = s[i];
        nr = (s[i+1]-'0')*10+(s[i+2]-'0');
        if ( a[x-'A'][nr] != 0 ){
            cout<<"GRESKA"; return 0;
        }
        a[x-'A'][nr] = 1; a[x-'A'][0]++;
    }
    cout<<13-a['P'-'A'][0]<<" "<<13-a['K'-'A'][0]<<" "<<13-a['H'-'A'][0]<<" "<<13-a['T'-'A'][0];
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 256 KB Output is correct
10 Correct 2 ms 376 KB Output is correct