Submission #1279769

#TimeUsernameProblemLanguageResultExecution timeMemory
1279769tullCombo (IOI18_combo)C++20
0 / 100
1 ms332 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { int p=0,r; char c[]={'A','B','X','Y'}; char sk,nt; string a=""; for(int i=0;i<4;++i){ char e=c[i]; nt=c[(i==3?0:i+1)]; r=press(a+e+nt); if(r>p){ a+=e; if(r-p==2){ a+=nt; ++p; nt='-'; } ++p; sk=e; break; } } while (p<N) { for(int i=0;i<4;++i){ char e=c[i]; if(e==sk or e==nt)continue; if(i!=3 and N-p>1)r=press(a+e+e); else if(i!=3 and N-p==1)r=press(a+e); else r=p+1; char nt=c[(i==3?0:i+1)]; if(r>p){ a+=e; if(r-p==2){ a+=nt; ++p; nt='-'; } ++p; break; } } } return a; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...