Submission #268475

# Submission time Handle Problem Language Result Execution time Memory
268475 2020-08-16T12:10:30 Z mayhoubsaleh Karte (COCI15_karte) C++14
50 / 50
1 ms 384 KB
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);


using namespace std;
const ll maxn=5e5+100;
const ll inf=1e9+10;

char c[]={'P','K', 'H', 'T'};
string s;
map<char,int>cnt;
map<string,bool>vis;
int main()
{
    IOS
    cin>>s;
    for(int i=0;i<s.size();i+=3){
        string t=s.substr(i,3);
        if(vis[t]){
            cout<<"GRESKA"<<endl;
            return 0;
        }
        vis[t]=1;
        cnt[t[0]]++;
    }

    for(int i=0;i<4;i++){
        cout<<13-cnt[c[i]]<<' ';
    }
    cout<<endl;
    return 0;
}

Compilation message

karte.cpp: In function 'int main()':
karte.cpp:19:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |     for(int i=0;i<s.size();i+=3){
      |                 ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 1 ms 384 KB Output is correct
8 Correct 0 ms 384 KB Output is correct
9 Correct 1 ms 384 KB Output is correct
10 Correct 0 ms 384 KB Output is correct