Submission #153868

# Submission time Handle Problem Language Result Execution time Memory
153868 2019-09-17T05:53:39 Z Divia Karte (COCI15_karte) C++14
50 / 50
2 ms 380 KB
#include <iostream>
using namespace std;
//ifstream cin("karte.in");
//ofstream cout("karte.out");
int i,j,t,lipsa,nr;
char s[2000];
int v[5][20];
int main()
{
    cin.getline(s,1000);
    for(i=0;s[i];i+=3){
        if(s[i]=='P')t=1;
        else if(s[i]=='K')t=2;
        else if(s[i]=='H')t=3;
        else if(s[i]=='T')t=4;
        nr=(s[i+1]-'0')*10+s[i+2]-'0';
        if(v[t][nr]==1){cout<<"GRESKA";return 0;}
        v[t][nr]=1;
    }
    for(i=1;i<=4;i++){
        lipsa=13;
        for(j=1;j<=13;j++)
            if(v[i][j])lipsa--;
        cout<<lipsa<<" ";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 380 KB Output is correct
2 Correct 2 ms 256 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 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 256 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