Submission #1348341

#TimeUsernameProblemLanguageResultExecution timeMemory
1348341argsxCombo (IOI18_combo)C++20
0 / 100
14 ms412 KiB
#include "combo.h"
#include<bits/stdc++.h>
using namespace std;
string p,ans;
std::string guess_sequence(int N) {
  if(press("AB")){
    if(press("A"))ans="A",p="BXY";
    else ans="B",p="AXY";
  }
  else{
    if(press("X"))ans="X",p="ABY";
    else ans="Y",p="ABX";
  }
  if(N==1)return ans;
  while(ans.size()<N-1){
    int t=press(ans+p[0]+ans+p[1]+p[0]+ans+p[1]+p[1]+ans+p[1]+p[2]);
    if(ans.size()==t)ans+=p[2];
    else if(ans.size()==t+1)ans+=p[0];
    else if(ans.size()==t+2)ans+=p[1];
  }
  if(press(ans+p[0])==N)return ans+p[0];
  else if(press(ans+p[1])==N)return ans+p[1];
  else return ans+p[2];
  
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...