제출 #360032

#제출 시각아이디문제언어결과실행 시간메모리
360032jesus_coconut콤보 (IOI18_combo)C++17
0 / 100
1 ms228 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string al = "ABXY"; string ret; if (press("AB")) { if (press("A")) ret = "A"; else ret = "B"; } else { if (press("XY")) ret = "X"; else ret = "Y"; } string pos; for (auto c : al) if (c != ret[0]) pos += c; for (int i = 1; i < N - 1; ++i) { string q = ret + pos[0]; for (auto c : pos) { q += ret + pos[1] + c; } int a = press(q); if (a == i) ret += pos[2]; else if (a == i + 1) ret += pos[0]; else ret += pos[1]; } if (press(ret + pos[0]) == N) ret += pos[0]; else if (press(ret + pos[1]) == N) ret += pos[1]; else ret += pos[2]; return ret; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...