Submission #998580

#TimeUsernameProblemLanguageResultExecution timeMemory
998580toast12Combo (IOI18_combo)C++14
0 / 100
45 ms344 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string ans = ""; ans += 'A'; int x = press(ans); vector<char> poss; if (x) poss = {'B', 'X', 'Y'}; else { ans[0] = 'B'; x = press(ans); if (x) poss = {'A', 'X', 'Y'}; else { ans[0] = 'X'; x = press(ans); if (x) poss = {'A', 'B', 'Y'}; else poss = {'A', 'B', 'X'}; } } while ((int)ans.size() < N) { for (char c : poss) { string s = ans; s += c; x = press(s); if (x > (int)ans.size()) { ans = s; break; } } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...