Submission #501338

#TimeUsernameProblemLanguageResultExecution timeMemory
501338shantolCombo (IOI18_combo)C++14
100 / 100
36 ms608 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N){ string a; string ex; for(int i=0;i<N;i++){ if(!i){ if(press("AB")){ if(press("A")){ a+="A"; ex="BXY"; } else { a+="B"; ex="AXY"; } } else if(press("X")){ a+="X"; ex="ABY"; } else { a+="Y"; ex+="ABX"; } } else if(i==N-1){ if(press(a+ex[0])==i+1){a+=ex[0];} else if(press(a+ex[1])==i+1){a+=ex[1];} else {a+=ex[2];} } else{ int p=press(a+ex[0]+ex[0]+a+ex[0]+ex[1]+a+ex[0]+ex[2]+a+ex[1]); if(p==i+2){a+=ex[0];} else if(p==i+1){a+=ex[1];} else {a+=ex[2];} } } return a; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...