Submission #485719

#TimeUsernameProblemLanguageResultExecution timeMemory
485719dongliu0426Combo (IOI18_combo)C++17
0 / 100
0 ms200 KiB
#include "combo.h" using namespace std; string guess_sequence(int N) { string s, c0, c1, c2; if (press("AB")) { if (press("A")) s = "a", c0 = "b", c1 = "x", c2 = "y"; else s = "b", c0 = "a", c1 = "x", c2 = "y"; } else { if (press("X")) s = "x", c0 = "a", c1 = "b", c2 = "y"; else s = "y", c0 = "a", c1 = "b", c2 = "x"; } for (int i = 1; i + 1 < N; i++) { int k = press(s + c0 + s + c1 + c0 + s + c1 + c1 + s + c1 + c2) - (int) s.size(); if (k == 0) s += c2; else if (k == 1) s += c0; else s += c1; } if (N > 1) { if (press(s + c0) == N) s += c0; else if (press(s + c1) == N) s += c1; else s += c2; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...