Submission #867744

#TimeUsernameProblemLanguageResultExecution timeMemory
867744ElenaBMCombo (IOI18_combo)C++17
0 / 100
0 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]; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...