Submission #146291

# Submission time Handle Problem Language Result Execution time Memory
146291 2019-08-23T10:06:32 Z Fasho Karte (COCI15_karte) C++14
50 / 50
3 ms 504 KB
#include <bits/stdc++.h>
#define N 1000005
#define ll long long int 	
#define MP make_pair
#define pb push_back
#define ppb pop_back
#define sp " "
#define endl "\n"
#define fi first
#define se second
#define ii pair<int,int>
#define lli pair<ll,ll>
#define fast cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
#define fast2 freopen ("kmp.in","r",stdin);freopen ("kmp.out","w",stdout);
#define mod 1000000009
#define fs(x,y) for(int i=1;i<=y;i++) cin>>x[i]
#define fo(i,x,y) for(int i=x;i<=y;i++)
#define INF 1000000000005
using namespace std;

ll n,m,ar[N],sum,tut[30][13],res[N];

char s[N];

int main()
{
	fast;
	cin>>s+1;
	n=strlen(s+1);
	fo(i,1,n)
	{
		ll x=(s[i+1]-'0')*10+s[i+2]-'0';
		if(tut[s[i]-'A'][x])
			return cout<<"GRESKA",0;
		tut[s[i]-'A'][x]=1;
		// cout<<s[i]<<sp<<x<<endl;
		res[s[i]-'A']++;
		i+=2;

	}


	cout<<13-res['P'-'A']<<sp;
	cout<<13-res['K'-'A']<<sp;
	cout<<13-res['H'-'A']<<sp;
	cout<<13-res['T'-'A']<<sp;


}



/*     cd onedrive\desktop\kod
cls


*/

Compilation message

karte.cpp: In function 'int main()':
karte.cpp:28:8: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  cin>>s+1;
       ~^~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 504 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 388 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 3 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct