제출 #1075353

#제출 시각아이디문제언어결과실행 시간메모리
1075353juicy콤보 (IOI18_combo)C++17
100 / 100
23 ms1852 KiB
#include "combo.h" #include <bits/stdc++.h> std::string guess_sequence(int n) { std::string c = "ABXY", cands, s; if (!press("AB")) { s = press("X") ? "X" : "Y"; } else { s = press("A") ? "A" : "B"; } if (n == 1) { return s; } for (int i = 0; i < 4; ++i) { if (c[i] != s[0]) { cands += c[i]; } } for (int i = 1; i + 1 < n; ++i) { auto msg = s + cands[1] + s + cands[2] + cands[0] + s + cands[2] + cands[1] + s + cands[2] + cands[2]; int ind = press(msg) - s.size(); s += cands[ind]; } if (press(s + cands[1]) == n) { return s + cands[1]; } return press(s + cands[0]) == n ? s + cands[0] : s + cands[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...