#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 time | Memory | Grader output |
---|
Fetching results... |