Submission #763103

#TimeUsernameProblemLanguageResultExecution timeMemory
763103t6twotwoCombo (IOI18_combo)C++17
100 / 100
27 ms604 KiB
#include "combo.h" using namespace std; string a[] = {"A", "B", "X", "Y"}; std::string guess_sequence(int N) { int f = 0; if (press("AB")) { f = press("B"); } else { f = press("Y") + 2; } string ans = a[f]; if (N == 1) { return ans; } string x = a[f == 0 ? 1 : 0]; string y = a[f <= 1 ? 2 : 1]; string z = a[f == 3 ? 2 : 3]; for (int i = 1; i < N - 1; i++) { int t = press(ans + x + ans + y + x + ans + y + y + ans + y + z); if (t == i + 1) { ans = ans + x; } else if (t == i + 2) { ans = ans + y; } else { ans = ans + z; } } if (press(ans + x) == N) { ans = ans + x; } else if (press(ans + y) == N) { ans = ans + y; } else { ans = ans + z; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...