Submission #348559

#TimeUsernameProblemLanguageResultExecution timeMemory
348559HalogenCombo (IOI18_combo)C++14
5 / 100
1 ms212 KiB
#include "combo.h" std::string guess_sequence(int N) { char lst[4] = {'A', 'B', 'X', 'Y'}; std::string p = ""; if (press(lst[0] + p + lst[1]) >= 1) { if (press(p + lst[0]) == 1){ p += lst[0]; lst[0] = lst[3]; } else { p += lst[1]; lst[1] = lst[3]; } } else if (press(p + lst[2]) == 1) { p += lst[2]; lst[2] = lst[3]; } else { p += lst[3]; } for (int j = 2; j < N; j++) { int result = press(p + lst[0] + p + lst[1] + lst[0] + p + lst[1] + lst[1] + p + lst[1] + lst[2]); if (result == j) p += lst[0]; else if (result == j + 1) p += lst[1]; else p += lst[2]; } if (press(p + lst[2]) == N) p += lst[2]; else if (press(p + lst[0]) == N) p += lst[0]; else p += lst[1]; return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...