제출 #1161208

#제출 시각아이디문제언어결과실행 시간메모리
1161208Aza콤보 (IOI18_combo)C++20
5 / 100
0 ms408 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
string guess_sequence(int N){
	string s;
	string g = "ABXY";
	char ign;
	for(int i = 0; i < 3; i++){
		string h;
		h += g[i];
		if(press(h) == 1){
			s += h;
			ign = g[i];
			break;
		}
	}
	if(s == ""){
		ign = g[3];
		s += ign;
	}
	string gg;
	for(int i = 0; i < 4; i++){
		if(g[i] == ign)continue;
		gg += g[i];
	}
	g = gg;
	for(int i = 2; i < N; i++){
		string p = s + g[0] + s + g[1] + g[0] + s + g[1] + g[1] + s + g[1] + g[2];
		if(press(p) == i){
			s += g[0];
		}
		else if(press(p) == i + 1){
			s += g[1];
		}
		else{
			s += g[2];
		}
	}
	string p = s + 'A' + s + 'B';
	if(press(p) == N){
		if(press(s + 'A') == N)s += 'A';
		else s += 'B';
	}
	else{
		if(press(s + 'X') == N)s += 'X';
		else s += 'Y';
	}
	return s;
}
/*



*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...