Submission #728417

#TimeUsernameProblemLanguageResultExecution timeMemory
728417MBICombo (IOI18_combo)C++17
30 / 100
43 ms584 KiB
#include "combo.h" // #include <iostream> using namespace std; string guess_sequence(int N) { int l=1,k; string p; if (press("A")){ p="A"; while (l<N){ if ((k=press(p+"B"))>l){ p+="B"; l++; } else if ((k=press(p+"X"))>l){ p+="X"; l++; } else { p+="Y"; l++; } } } else if (press("B")){ p="B"; while (l<N){ if ((k=press(p+"A"))>l){ p+="A"; l++; } else if ((k=press(p+"X"))>l){ p+="X"; l++; } else { p+="Y"; l++; } } } else if (press("X")){ p="X"; while (l<N){ if ((k=press(p+"B"))>l){ p+="B"; l++; } else if ((k=press(p+"A"))>l){ p+="A"; l++; } else { p+="Y"; l++; } } } else { p="Y"; while (l<N){ if ((k=press(p+"B"))>l){ p+="B"; l++; } else if ((k=press(p+"X"))>l){ p+="X"; l++; } else { p+="A"; l++; } } } // cerr << p << " \n"; return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...