제출 #298884

#제출 시각아이디문제언어결과실행 시간메모리
298884lani1akea콤보 (IOI18_combo)C++17
5 / 100
1 ms200 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { string s = ""; char v[] = {'A', 'B', 'X', 'Y'}; int x; if (press("AB")) { x = press("A") != 1; } else { x = (press("X") ? 2 : 3); } s += v[x]; swap(v[x], v[3]); for (int i = 1; i < N - 1; ++i) { x = press(s + v[0] + v[0] + s + v[0] + v[1] + s + v[0] + v[2] + s + v[1]); if (x == i + 2) s += v[0]; else if (x == i + 1) s += v[1]; else s += v[2]; } if (press(s + v[0] + s + v[1]) == N) { if (press(s + v[0]) == N) s += v[0]; else s += v[1]; } else s += v[2]; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...