Submission #823524

#TimeUsernameProblemLanguageResultExecution timeMemory
823524handlewastakenCombo (IOI18_combo)C++17
5 / 100
1 ms256 KiB
#include "combo.h" #include <string> using namespace std; string guess_sequence(int n) { string s, t; int i, er = press("AB"), se = press("AX"); if (er > 0) { if (se > 0) t = "ABXY"; else t = "BXYA"; } else { if (se > 0) t = "XYAB"; else t = "YABX"; } s = t[0]; for (i = 2; i < n; i++) { er = press(s + t[1] + s + t[2] + t[1] + s + t[2] + t[2] + s + t[2] + t[3]); if (er == i) s += t[1]; else if (er == i + 1) s += t[2]; else s += t[3]; } er = press(s + t[1]); se = press(s + t[2]); if (er == n) s += t[1]; else if (se == n) s += t[2]; else s += t[3]; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...