Submission #156120

# Submission time Handle Problem Language Result Execution time Memory
156120 2019-10-03T14:49:52 Z mdn2002 Karte (COCI15_karte) C++14
10 / 50
2 ms 376 KB
#include<bits/stdc++.h>
using namespace std;
long long mod=1e9+7;
int ans[5];
bool an[5][15];
int main()
{
    string s;
    cin>>s;
    for(int i=0;i<s.size();i+=3)
    {
        int x;
        x=((s[i+1]-'0')*10)+(s[i+2]-'0');
        if(s[i]=='P')
        {
            if(an[0][x]==true)
            {
                cout<<"GRESKA";
                return 0;
            }
            ans[0]++;
            an[0][x]=true;
        }
        if(s[i]=='K')
        {
            if(an[0][x]==true)
            {
                cout<<"GRESKA";
                return 0;
            }
            ans[1]++;
            an[0][x]=true;
        }
        if(s[i]=='H')
        {
            if(an[0][x]==true)
            {
                cout<<"GRESKA";
                return 0;
            }
            ans[2]++;
            an[0][x]=true;
        }
        if(s[i]=='T')
        {
            if(an[0][x]==true)
            {
                cout<<"GRESKA";
                return 0;
            }
            ans[3]++;
            an[0][x]=true;
        }
    }
    for(int i=0;i<4;i++)cout<<13-ans[i]<<' ';
}

Compilation message

karte.cpp: In function 'int main()':
karte.cpp:10:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<s.size();i+=3)
                 ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Correct 2 ms 376 KB Output is correct
4 Incorrect 2 ms 376 KB Output isn't correct
5 Incorrect 2 ms 256 KB Output isn't correct
6 Incorrect 2 ms 256 KB Output isn't correct
7 Incorrect 2 ms 376 KB Output isn't correct
8 Incorrect 2 ms 376 KB Output isn't correct
9 Incorrect 2 ms 256 KB Output isn't correct
10 Correct 2 ms 256 KB Output is correct