답안 #650266

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
650266 2022-10-13T09:33:05 Z Codula Karte (COCI15_karte) C++17
50 / 50
1 ms 328 KB
//IOI 2023 I am coming.
 
#include "bits/stdc++.h"
 
using namespace std;
 
#define fast ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define int int64_t
#define pb push_back
#define deb(x) cerr<<"("<<#x<<"="<<x<<','<<__LINE__<<")"<<endl; 
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); 
 
int32_t main(){
	fast;
	string s;
	cin>>s;
	int n=s.size();
	map<char,int>ans;
	map<string,int>mp;
	for(int i=0;i<n;i+=3){
		string dx="";
		dx+=(s[i]);//+s[i+1]+s[i+2];
		dx+=(s[i+1]);
		dx+=(s[i+2]);
		ans[dx[0]]+=1;
		if(mp[dx]){
			cout<<"GRESKA\n";
			return 0;
		}
		mp[dx]+=1;
	}
	for(auto i:{'P','K','H','T'}){
		//~ cout<<13-ans[i]<<" ";
		cout<<13-ans[i]<<" ";
	}
	cout<<"\n";
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 320 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 328 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 328 KB Output is correct
10 Correct 1 ms 212 KB Output is correct