Submission #998583

#TimeUsernameProblemLanguageResultExecution timeMemory
998583toast12Combo (IOI18_combo)C++14
30 / 100
33 ms964 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'}; ans[0] = 'Y'; } } } while ((int)ans.size() < N) { string s = ans; s += poss[0]; x = press(s); if (x > (int)ans.size()) { ans = s; continue; } s.pop_back(); s += poss[1]; x = press(s); if (x > (int)ans.size()) { ans = s; continue; } s.pop_back(); s += poss[2]; ans = s; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...