Submission #268475

#TimeUsernameProblemLanguageResultExecution timeMemory
268475mayhoubsalehKarte (COCI15_karte)C++14
50 / 50
1 ms384 KiB
#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 (stderr)

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