Submission #111561

#TimeUsernameProblemLanguageResultExecution timeMemory
111561superbamboo123Combo (IOI18_combo)C++14
100 / 100
64 ms520 KiB
#include "combo.h" #include <iostream> std::string guess_sequence(int N) { std::string s; std::string r,t; int c,i; if (press("AB")>0) { if (press("A")>0) { r="A"; s="BXY"; } else { r="B"; s="AXY"; } } else { if (press("X")>0) { r="X"; s="ABY"; } else { r="Y"; s="ABX"; } } for (i=1;i<N-1;i++) { t=r+s[0]+r+s[1]+s[0]+r+s[1]+s[1]+r+s[1]+s[2]; c=press(t)-i; if (c==0) { r+=s[2]; } else if (c==1) { r+=s[0]; } else { r+=s[1]; } } if (N>1) { if (press(r+s[0])==N) r+=s[0]; else if (press(r+s[1])==N) r+=s[1]; else r+=s[2]; } return r; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...