Submission #713060

#TimeUsernameProblemLanguageResultExecution timeMemory
713060tht2005Combo (IOI18_combo)C++17
30 / 100
89 ms552 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; const string BUTTONS = "ABXY"; string tmp[4]; int solve(int l, int r) { if(l == r) { return l; } int m = (l + r) >> 1; string combo; for(int i = l; i <= m; ++i) { for(char ch : tmp[i]) { combo.push_back(ch); } } if(press(combo) >= (int)tmp[0].size()) { return solve(l, m); } return solve(m + 1, r); } string guess_sequence(int N) { string res; for(int i = 1; i <= N; ++i) { for(int j = 0; j < 4; ++j) { tmp[j] = res; tmp[j].push_back(BUTTONS[j]); } res.push_back(BUTTONS[solve(0, 3)]); } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...