Submission #1130406

#TimeUsernameProblemLanguageResultExecution timeMemory
1130406AndrijaMKarte (COCI15_karte)C++20
50 / 50
0 ms328 KiB
#include <bits/stdc++.h> using namespace std; #define int long long ///#define endl '\n' const int maxn=2e5+10; const int mod=1e9+7; int ans[4]; int f(char suit) { if(suit=='P') { return 0; } if(suit=='K') { return 1; } if(suit=='H') { return 2; } if(suit=='T') { return 3; } } signed main() { ios::sync_with_stdio(false); ///freopen("dulciuri.in","r",stdin); ///freopen("dulciuri.out","w",stdout); string s; cin>>s; int n=s.size(); map<string,int>m; for(int i=0;i<4;i++) { ans[i]=13; } for(int i=0;i<n;i+=3) { string a=""; for(int j=0;j<3;j++) { a+=s[j+i]; } m[a]++; ans[f(s[i])]--; } for(auto ax:m) { if(ax.second>1) { cout<<"GRESKA"<<endl; return 0; } } for(int i=0;i<4;i++) { cout<<ans[i]<<" "; } cout<<endl; return 0; }

Compilation message (stderr)

karte.cpp: In function 'long long int f(char)':
karte.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...