제출 #947730

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9477302024-03-17 00:54:14biank콤보 (IOI18_combo)C++14
100 / 100
15 ms2152 KiB
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
string s = "";
if (press("AB")) {
if (press("A")) s += 'A';
else s += 'B';
} else {
if (press("X")) s += 'X';
else s += 'Y';
}
if (N == 1) return s;
string buttons = "";
for (char c : "ABXY"s) {
if (c != s[0]) buttons += c;
}
for (int i = 1; i < N - 1; i++) {
string combo = "";
for (int j = 0; j < 3; j++) {
combo += s + buttons[2] + buttons[j];
}
combo += s + buttons[1];
int coins = press(combo);
s += buttons[coins - i];
}
for (int j = 0; j < 2; j++) {
if (press(s + buttons[j]) == N) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...