제출 #1356057

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

char a[4] = {'A','B','Y','X'};

string guess_sequence(int N) {
  string p = "";
  for(int i = 0;i < 3;i++){
    string x;
    x += a[i];
    int v = press(x);
    if(v == 1){
      p += a[i];
      swap(a[0],a[i]);
      break;
    }
  }
  if(p.empty()){
    p += a[3];
    swap(a[0],a[3]);
  }
  for(int i = 1;i < N - 1;i++){
    string t = p + a[1] + a[1] + p + a[1] + a[2] + p + a[1] + a[3] + p + a[2];
    int x = press(t);
    if(x == i)p += a[3];
    else if(x == i + 1)p += a[2];
    else p += a[1];
  }
  for(int i = 1;i < 3;i++){
    string x = p + a[i];
    int v = press(x);
    if(v == N){
      p += a[i];
      break;
    }
  }
  if((int)p.size() < N)p += a[3];
  return p;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…