제출 #467778

#제출 시각아이디문제언어결과실행 시간메모리
467778imas_713_a콤보 (IOI18_combo)C++14
0 / 100
1 ms200 KiB
# include <bits/stdc++.h>
using namespace std;
 
# define ll long long
# define ld long double
# define pb push_back
# define pob pop_back
# define mp make_pair
# define fi first
# define se second
# define all(x) x.begin(),x.end() 
# define ts to_string
# define ti(a) atoi(a.c_str())
# define NumAfterDecimalP(x) cout<<setprecision(x)<<fixed
 
const ld pi = 2*acos(0.0);
const ll inf = LLONG_MAX;
const ll mod = 1e9+7;

#include "combo.h"

std::string guess_sequence(int N) {
    string ans="";
	string c1="A",c2="B",c3="X";
	bool a=true,b=true,x=true;
	ll k1=press(c1),k2=press(c2),k3=press(c3);
	if(k1==1) a=false,ans+=c1;
	else if(k2==1) b=false,ans+=c2;
	else if(k3==1) x=false,ans+=c3;
	for(int i=2; i<=N; i++){
		if(a){
			ans+="A";
			ll kj=press(ans);
			if(kj==i) continue;
			ans.pop_back();
		}
        if(b){
            ans+="B";
			ll kj=press(ans);
			if(kj==i) continue;
			ans.pop_back();
		}
        if(x){
            ans+="X";
			ll kj=press(ans);
			if(kj==i) continue;
			ans.pop_back();
		}
        ans+="Y";
	}
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...