Submission #97637

#TimeUsernameProblemLanguageResultExecution timeMemory
97637songcCombo (IOI18_combo)C++14
100 / 100
49 ms512 KiB
#include "combo.h" using namespace std; string guess_sequence(int N) { string p, q, r; string S; if (press("AB")){ if (press("A")) S="A", p="B", q="X", r="Y"; else p="A", S="B", q="X", r="Y"; } else{ if (press("X")) p="A", q="B", S="X", r="Y"; else p="A", q="B", r="X", S="Y"; } if (N == 1) return S; for (int i=1; i<N-1; i++){ int ret = press(S+p+p+S+p+q+S+p+r+S+q); if (ret == i) S += r; if (ret == i+1) S += q; if (ret == i+2) S += p; } if (press(S+p) == N) return S+p; if (press(S+q) == N) return S+q; return S+r; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...