Submission #339214

#TimeUsernameProblemLanguageResultExecution timeMemory
339214ammar2000Karte (COCI15_karte)C++17
50 / 50
1 ms364 KiB
#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 (stderr)

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 timeMemoryGrader output
Fetching results...