제출 #1022971

#제출 시각아이디문제언어결과실행 시간메모리
1022971HishamAlshehri콤보 (IOI18_combo)C++17
0 / 100
1 ms344 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string s = ""; string t = "ABXYABXY"; int c = press("ABB"); if (c == 2) { s += 'A'; } else if (c == 1) s += 'B'; else { c = press("XYY"); if (c == 1) s += 'Y'; else s += 'X'; } int idx = 0; for (int i = 0; i < 4; i++) if(s[0] == t[i]) {idx = i; break;}; char q1 = t[idx + 1], q2 = t[idx + 2], q3 = t[idx + 3]; for (int i = 1; i < N; i++) { c = press(s + q1 + s + q2 + q1 + s + q2 + q2 + s + q2 + q3); if (!c) s += q3; else if (c == 1) s += q1; else s += q3; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...