Submission #339214

# Submission time Handle Problem Language Result Execution time Memory
339214 2020-12-24T20:45:00 Z ammar2000 Karte (COCI15_karte) C++17
50 / 50
1 ms 364 KB
#include <bits/stdc++.h>
using namespace std;
string s;
map <pair <int , char >,int > mp;
map <char ,int > mapp;
int c;
int main()
{
    cin>>s;
    for (int i=0;i<s.length()-2;i+=3)
    {
        int no=(s[i+1]-'0')*10+(s[i+2]-'0');
        mp[{no,s[i]}]++;
        if (mp[{no,s[i]}]>1)
            {
                cout <<"GRESKA";
                return 0;
            }
        mapp[s[i]]++;
    }
    cout <<13-mapp['P']<< " "<<13-mapp['K']<<" "<<13-mapp['H']<<" "<<13-mapp['T'];
    return 0;
}

Compilation message

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