제출 #1043715

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

string guess_sequence(int N) {
  string p = "";string S = "";
  if(press("AB")>=1){
    if(press("A")==1){
      p+="A";
    }
    else{
      p+="B";
    }
  }
  else{
    if(press("X")>=1){
      p+="X";
    }
    else{
      p+="Y";
    }
  }
  vector<string> a;
  if(p!="A")a.push_back("A");
  if(p!="B")a.push_back("B");
  if(p!="X")a.push_back("X");
  if(p!="Y")a.push_back("Y");

  for(int i=0;i<N-1;i++){
    string temp="";
    temp+=(p+a[0]+p+a[1]+a[0]+p+a[1]+a[1]+p+a[1]+a[2]);
    if(press(temp)==2){
      p+=a[0];
    }
    if(press(temp)==3){
      p+=a[1];
    }else{
      p+=a[2];
    }
  }
  if(N>1){
    if(press(p+a[0]+p+a[1])>=1){
      if(press(p+a[0])==1){
        p+=a[0];
      }
      else{
        p+=a[1];
      }
    }
    else{
      p+=a[2];
    }
  }
  return S;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...