제출 #853502

#제출 시각아이디문제언어결과실행 시간메모리
853502lamterCombo (IOI18_combo)C++14
10 / 100
31 ms1212 KiB
#include "combo.h"
#include <bits/stdc++.h>

const std::string KEYS = "ABXY";

std::string guess_sequence(int n) {
	char ban = ' ';
	std::string ans;
	auto which = [&] (void) -> char {
		for (int i = 0; i < 3; i += 1) if (KEYS[i] != ban and press(ans + KEYS[i]) == (int) ans.size() + 1)
			return KEYS[i];
		return KEYS[3];
	};

	for (int i = 0; i < n; i += 1) {
		char c = which();
		if (not i)
			ban = c;
		ans += c;
	}

	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...