제출 #629853

#제출 시각아이디문제언어결과실행 시간메모리
629853airths콤보 (IOI18_combo)C++17
5 / 100
1 ms332 KiB
#include "combo.h"
#include <bits/stdc++.h>
std::string guess_sequence(int N) {
  std::string p = "";
  std::string c="";
  if (press("AB")>0){
    if (press("A")==1){
      c="BXY"; p="A";
    }
    else {
      c="AXY"; p="B";
    }
  } else {
    if (press("X")==1){
      c="ABY"; p="X";
    }
    else {
      c="ABX"; p="Y";
    }
  }
  for (int i=1; i<N-1; i++){
    int coins=press(p+c[0]+c[0]+p+c[0]+c[1]+p+c[0]+c[2]+p+c[1]);
    if (coins==i+1){
      p+=c[1];
    } else if (coins==i+2){
      p+=c[0];
    } else {
      p+=c[2];
    }
  }
  if (press(p+c[0])==N){
    p+=c[0];
  } else if (press(p+c[1])==N){
    p+=c[1];
  } else {
    p+=c[2];
  }
  return p;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...