Submission #119924

#TimeUsernameProblemLanguageResultExecution timeMemory
119924BoxworldCombo (IOI18_combo)C++14
100 / 100
41 ms564 KiB
#include <bits/stdc++.h> using namespace std; #include "combo.h" std::string guess_sequence(int N) { string S,a,b,c; if (press("AB")>=1){ if(press("A")==1)S="A",a="B",b="X",c="Y"; else S="B",a="A",b="X",c="Y"; }else{ if(press("X")==1)S="X",a="A",b="B",c="Y"; else S="Y",a="A",b="B",c="X"; } for (int i=1;i<N-1;i++){ string p=S+a+S+b+a+S+b+b+S+b+c; int X=press(p); if (X==i)S+=c; else if(X==i+1)S+=a; else S+=b; } if(N>1){ if (press(S+a+S+b)==N){ if (press(S+a)==N)S+=a;else S+=b; }else S+=c; } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...