Submission #696559

# Submission time Handle Problem Language Result Execution time Memory
696559 2023-02-06T21:21:05 Z alumno3435 Karte (COCI15_karte) C++14
50 / 50
1 ms 300 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    string S;
    cin>>S;
    int k = S.size()/3;
    set<int> P;
    set<int> K;
    set<int> H;
    set<int> T;
    int aux;
    for(int i=0; i<k; i++){
        aux = 10*(int)(S[3*i+1]-'0') + (int)(S[3*i+2]-'0');
        if(S[3*i]=='P'){
            P.insert(aux);
        }else if(S[3*i]=='K'){
            K.insert(aux);
        }else if(S[3*i]=='H'){
            H.insert(aux);
        }else{
            T.insert(aux);
        }
    }
    if((P.size()+K.size()+H.size()+T.size())<k){
        cout<<"GRESKA"<<endl;
    }else{
        cout<<13-P.size()<<" "<<13-K.size()<<" "<<13-H.size()<<" "<<13-T.size()<<endl;
    }

    return 0;
}

Compilation message

karte.cpp: In function 'int main()':
karte.cpp:27:45: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   27 |     if((P.size()+K.size()+H.size()+T.size())<k){
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 300 KB Output is correct
4 Correct 0 ms 300 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 296 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct