제출 #805516

#제출 시각아이디문제언어결과실행 시간메모리
805516Malix콤보 (IOI18_combo)C++14
5 / 100
1 ms284 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;

std::string guess_sequence(int N) {
  string m;
  std::string p = "";
  std::string S = "";
  int t;
  t=press("AB");
  if(t){
    t=press("A");
    if(t){S+="A";m="BXY";}
    else {S+="B";m="AXY";}
  }
  else{
    t=press("X");
    if(t){S+="X";m="ABY";}
    else {S+="Y";m="ABX";}
  }
  for(int i=0;i<N-2;i++){
    t=press(S+m[0]+S+m[1]+m[0]+S+m[1]+m[1]+S+m[1]+m[2]);
    if(t==i+1)S+=m[2];
    else if(t==i+2)S+=m[0];
    else S+=m[1];
  }
  t=press(S+m[0]);
  if(t==N)S+=m[0];
  else if(press(S+m[1])==N)S+=m[1];
  else S+=m[2];

  return S;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...