# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
650103 | berr | Karte (COCI15_karte) | C++17 | 1 ms | 212 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
/*#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif */
string s; cin>>s;
int f=s.size()/3;
set<string> q[4];
for(int i=0; i<s.size(); i+=3)
{
string h=s.substr(i+1, 2);
if(s[i]=='P')
q[0].insert(h);
else if(s[i]=='K')
q[1].insert(h);
else if(s[i]=='H')
q[2].insert(h);
else
q[3].insert(h);
}
if((s.size()/3)!=(q[3].size()+q[2].size()+q[1].size()+q[0].size()))
{
cout<<"GRESKA";
}
else
{
for(int i=0; i<4; i++)
{
cout<<13-q[i].size()<<" ";
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |