Submission #523425

#TimeUsernameProblemLanguageResultExecution timeMemory
523425dron_rpCombo (IOI18_combo)C++14
10 / 100
53 ms532 KiB
#include "combo.h" #include <set> #include <iostream> using namespace std; string guess_sequence(int N) { string S = ""; set<char> a = {'A', 'B', 'X', 'Y'}; string p = ""; for (auto& c : a){ p = ""; p += c; int coins = press(p); if (coins == 1){ S += c; a.erase(c); break; } } //cout << S << "\n"; while ((int) S.size() < N){ int idx = 1; for (auto& c : a){ if (idx >= 3) break; p = S; p += c; int coins = press(p); if (coins == (int) S.size()+1){ S += c; break; } idx++; } //cout << idx << "\n"; if (idx >= 3) S += *prev(a.end()); //cout << S << "\n"; } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...