# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1130406 | AndrijaM | Karte (COCI15_karte) | C++20 | 0 ms | 328 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;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |