제출 #282780

#제출 시각아이디문제언어결과실행 시간메모리
282780sofapudenCombo (IOI18_combo)C++14
10 / 100
77 ms556 KiB
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int N){
	string ans;
	vector<char> v;
	if(press("A")){
		ans+="A";
		v.push_back('B');
		v.push_back('X');
		v.push_back('Y');
	}
	else if(press("B")){
		ans+="B";
		v.push_back('A');
		v.push_back('X');
		v.push_back('Y');
	}
	else if(press("X")){
		ans+="X";
		v.push_back('B');
		v.push_back('A');
		v.push_back('Y');
	}
	else {
		ans+="Y";
		v.push_back('B');
		v.push_back('X');
		v.push_back('A');
	}
	for(int i = 2; i <= N; ++i){
		ans+="?";
		for(int j = 0; j < 3; ++j){
			ans[i-1] = v[j];
			if(press(ans) == i)break;
		}
	}
	return ans;
}
			
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...