Submission #867748

#TimeUsernameProblemLanguageResultExecution timeMemory
867748ElenaBMCombo (IOI18_combo)C++17
0 / 100
1 ms344 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence (int N){ vector<char>sec(3); string ans = ""; if (press("AB") > 0){ if (press("A")) { ans += 'A'; sec[0] = 'B'; } else { ans += 'B'; sec[0] = 'A'; } sec[1] = 'X'; sec[2] = 'Y'; } else{ sec[0] = 'A'; sec[1] = 'B'; if (press("X")) { ans += 'X'; sec[2] = 'Y'; } else { ans += 'Y'; } } for (int i = 2; i < N; ++i){ string guess = ans + sec[0] + ans + sec[1] + sec[0] + ans + sec[1] + sec[1] + ans + sec[1] + sec[2]; int x = press(guess); if (x == i) ans += sec[0]; else if (x == i+1) ans += sec[1]; else ans += sec[2]; } string fguess = ans + sec[0]; if (press(ans+sec[0]) == N)return ans+ sec[0]; else if (press(ans+sec[1]) == N) return ans + sec[1]; else return ans + sec[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...