Submission #513922

#TimeUsernameProblemLanguageResultExecution timeMemory
513922thegrimbeeCombo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string ans = "", s = ""; int temp; if (press("AB")){ if (press("A"))ans = "A"; else ans = "B"; } else{ if (press("X"))ans = "X"; else ans = "Y"; } for (auto x : "ABXY"){ if (x != ans[0])s += x; } if (N == 1)return ans; for (int i = 1; i < N-1; ++i){ temp = press(ans + s[0] + ans + s[1] + s[0] + ans + s[1] + s[1] + ans + s[1] + s[2]); cout << ans + s[0] + ans + s[1] + s[0] + ans + s[1] + s[1] + ans + s[1] + s[2] << ' ' << temp << ' '; if (temp == i + 1){ ans = ans + s[0]; } else if (temp == i + 2){ ans = ans + s[1]; } else ans = ans + s[2]; } if (press(ans + s[0] + ans + s[1]) == N){ if (press(ans + s[0]) == N)ans = ans + s[0]; else ans = ans + s[1]; } else ans = ans + s[2]; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...