Submission #1200959

#TimeUsernameProblemLanguageResultExecution timeMemory
1200959waigoonCombo (IOI18_combo)C++20
30 / 100
11 ms472 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string ans; int first = press("AB"); if (first == 2) ans += 'A'; else if (first == 1) ans += (press("A") == 1 ? 'A' : 'B'); else ans += (press("X") == 1 ? 'X' : 'Y'); for (int i = 1; i < N; i++) { string st = ans + 'A' + ans + 'B'; int choose = press(st); if (choose == ans.length() + 1) { int a = press(ans+'A'); if (a == ans.length()) ans += 'B'; else ans += 'A'; } else { int x = press(ans+'X'); if (x == ans.length()) ans += 'Y'; else ans += 'X'; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...