답안 #153849

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
153849 2019-09-17T04:58:10 Z AldeaDanut Karte (COCI15_karte) C++14
50 / 50
2 ms 376 KB
#include <iostream>
using namespace std;

char s[1010],x,y;
int v[5][15],i,j,n;

int main(){
    cin.get(s,1001);
    while(s[j]!=0){
        i=(s[j+1]-'0')*10+(s[j+2]-'0');
        if(s[j]=='P'){
            if(v[1][i]==1){
                cout<<"GRESKA";
                return 0;
            }
            v[1][0]++;
            v[1][i]=1;
        }
        if(s[j]=='K'){
            if(v[2][i]==1){
                cout<<"GRESKA";
                return 0;
            }
            v[2][0]++;
            v[2][i]=1;
        }
        if(s[j]=='H'){
            if(v[3][i]==1){
                cout<<"GRESKA";
                return 0;
            }
            v[3][0]++;
            v[3][i]=1;
        }
        if(s[j]=='T'){
            if(v[4][i]==1){
                cout<<"GRESKA";
                return 0;
            }
            v[4][0]++;
            v[4][i]=1;
        }

        j+=3;
    }
    cout<<13-v[1][0]<<" "<<13-v[2][0]<<" "<<13-v[3][0]<<" "<<13-v[4][0];

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 252 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 252 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 256 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 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct