제출 #998481

#제출 시각아이디문제언어결과실행 시간메모리
998481ezzzayCombo (IOI18_combo)C++14
10 / 100
47 ms996 KiB
#include "combo.h"
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
std::string guess_sequence(int N) {
  int k=0;
  string p;
  for(int i=0;i<N;i++){
    string tmp;
    if(i>0){
      if(p[0]!='X'){
         tmp=p+'X';
    if(press(tmp)==k+1){
      p+='X';
      k++;
      continue;
    }
      }

      if(p[0]!='Y'){
         tmp=p+'Y';
    if(press(tmp)==k+1){
      p+='Y';
      k++;
      continue;
    }
      }
      if(p[0]!='A'){
         tmp=p+'A';
    if(press(tmp)==k+1){
      p+='A';
      k++;
      continue;
    }
      }
      if(p[0]!='B'){
         tmp=p+'B';
    if(press(tmp)==k+1){
      p+='B';
      k++;
      continue;
    }
      }
      continue;
    }
    tmp=p+'X';
    if(press(tmp)==k+1){
      p+='X';
      k++;
      continue;
    }
    tmp=p+'Y';
    if(press(tmp)==k+1){
      p+='Y';
      k++;
      continue;
    }
    tmp=p+'A';
    if(press(tmp)==k+1){
      p+='A';
      k++;
      continue;
    }
    tmp=p+'B';
    if(press(tmp)==k+1){
      p+='B';
      k++;
      continue;
    }
  }
  
  return p;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...