제출 #510158

#제출 시각아이디문제언어결과실행 시간메모리
510158tabr콤보 (IOI18_combo)C++17
100 / 100
34 ms660 KiB
#include <bits/stdc++.h> using namespace std; #ifdef tabr #include "library/debug.cpp" #else #define debug(...) #endif int press(string); string guess_sequence(int n) { string t = "ABXY"; int id = 0; if (press("XY")) { id |= 2; } if (press("BY")) { id |= 1; } string res = t.substr(id, 1); t.erase(t.begin() + id); for (int i = 1; i < n - 1; i++) { res += t[press(res + t[1] + res + t[2] + t[0] + res + t[2] + t[1] + res + t[2] + t[2]) - i]; } if (n > 1) { if (press(res + t[0]) == n) { res += t[0]; } else if (press(res + t[1]) == n) { res += t[1]; } else { res += t[2]; } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...