Submission #770224

#TimeUsernameProblemLanguageResultExecution timeMemory
770224boyliguanhanCombo (IOI18_combo)C++17
5 / 100
1 ms256 KiB
#include "combo.h" std::string guess_sequence(int N) { std::string str; int res; char a,b,c; if(press("AB")) if(press("A")) str="A",a='B',b='X',c='Y'; else str="B",a='A',b='X',c='Y'; else if(press("X")) str = "X",a='Y',b='A',c='B'; else str = "Y",a='X',b='A',c='B'; for(int i = 1; i < N-1; i++) { res = press(str+a+str+b+a+str+b+b+str+b+c); if(res==i) str+=c; if(res==i+1) str+=a; if(res==i+2) str+=b; } if(press(str+a)==N) str+=a; else if(press(str+b)==N) str+=b; else str+=c; return str; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...