Submission #88858

#TimeUsernameProblemLanguageResultExecution timeMemory
88858maruiiCombo (IOI18_combo)C++17
0 / 100
2 ms200 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';
  }
  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])) S += c[1];
  else S += c[2];
  return S;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...