제출 #853519

#제출 시각아이디문제언어결과실행 시간메모리
853519lamter콤보 (IOI18_combo)C++17
0 / 100
0 ms344 KiB
#include "combo.h" #include <bits/stdc++.h> std::string guess_sequence(int n) { std::vector <char> KEYS = {'A', 'B', 'X', 'Y'}; std::string ans = press("AB") ? press("A") ? "A" : "B" : press("X") ? "X" : "Y"; KEYS.erase(std::find(KEYS.begin(), KEYS.end(), ans[0])); while ((int) ans.size() <= n) { int t = press(ans + KEYS[0] + KEYS[0] + ans + KEYS[0] + KEYS[1] + ans + KEYS[1] + KEYS[0]); if (t == (int) ans.size()) ans += KEYS[2]; if (t == (int) ans.size() + 1) ans += (press(ans + KEYS[0]) == (int) ans.size() ? KEYS[1] : KEYS[0]) + KEYS[2]; if (t == (int) ans.size() + 2) { int tt = press(ans + KEYS[0] + KEYS[0]); if (tt == (int) ans.size()) ans += KEYS[1] + KEYS[0]; if (tt == (int) ans.size() + 1) ans += KEYS[0] + KEYS[1]; if (tt == (int) ans.size() + 2) ans += KEYS[0] + KEYS[0]; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...