Submission #88864

#TimeUsernameProblemLanguageResultExecution timeMemory
88864maruiiCombo (IOI18_combo)C++17
100 / 100
52 ms556 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; char cc[]="ABXY"; string c; string guess_sequence(int N) { string p, S; if(press("AB")){ if(press("A"))S += 'A'; else S += 'B'; } else{ if(press("X"))S += 'X'; else S += 'Y'; } if(N==1)return S; for(int i=0; i<4; ++i) if(cc[i]!=S[0])c += cc[i]; for(int i=1; i<N-1; ++i){ p = ""; for(int j=0; j<3; ++j) p += S+c[0]+c[j]; p += S+c[1]; int t = press(p)-i; if(t == 2)S += c[0]; else if(t)S += c[1]; else S += c[2]; } if(press(S+c[0])==N) S += c[0]; else if(press(S+c[1])==N) S += c[1]; else S += c[2]; return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...