Submission #205164

#TimeUsernameProblemLanguageResultExecution timeMemory
205164SoGoodCombo (IOI18_combo)C++17
10 / 100
92 ms540 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { vector<char> v = {'A', 'B', 'X', 'Y'}; string ans=""; for (char d : v) { string ask=""; ask+=d; if (press(ask) == 1) { ans+=ask; break; } } int need=2; for (int i = 1; i < N; ++i) { for (char d : v) { if (d==ans[0]) continue; ans+=d; if (press(ans)==need) { ++need; break; } ans.pop_back(); } } // cout<<"CH "<<ans<<'\n'; return ans; } /** abcccbd abacad */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...