Submission #362337

#TimeUsernameProblemLanguageResultExecution timeMemory
362337usuyusCombo (IOI18_combo)C++14
5 / 100
2 ms260 KiB
#include "combo.h" using namespace std; string all = "ABXY"; string guess_sequence(int n) { string res; int beg = -1; if (press("AB")) { if (press("A")) beg = 0; else beg = 1; } else { if (press("X")) beg = 2; else beg = 3; } res += all[beg]; char x = all[(beg+1)%4], y = all[(beg+2)%4], z = all[(beg+3)%4]; for (int i=2; i<n; i++) { int tmp = press(res+x + res+y+x + res+y+y + res+y+z); if (tmp == i-1) res += z; else if (tmp == i) res += x; else res += y; } if (press(res+x) == n) res += x; else if (press(res+y) == n) res += y; else res += z; return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...