제출 #85515

#제출 시각아이디문제언어결과실행 시간메모리
85515JustasLe콤보 (IOI18_combo)C++17
0 / 100
1 ms200 KiB
/*input

*/
#include <bits/stdc++.h>
#include "combo.h"

using namespace std;

string guess_sequence(int N) {
	string ans = "";
	string poss = "ABXY";
	for (int i = 0; i < 4; i++) {
		string temp = "" + poss[i];
		int cnt = press(temp);
		if (cnt > 0) {
			poss.erase(poss.begin() + i);
			ans += temp;
			break;
		}
	}
	bool ok = true;
	int prev = 1;
	while (ok) {
		ok = false;
		for (int i = 0; i < 3; i++) {
			string newAns = ans + "" + poss[i];
			int cnt = press(newAns);
			if(cnt > prev) {
				ans = newAns;
				ok = true;
				prev = cnt;
				break;
			}
		}
	}
	return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...