제출 #1146727

#제출 시각아이디문제언어결과실행 시간메모리
1146727kvintsekstakordCombo (IOI18_combo)C++20
0 / 100
0 ms408 KiB
#include "combo.h"
#include <bits/stdc++.h>

using namespace std;

string chars = "ABXY";

string guess_sequence(int N) {
  
  string S = "";
  for(int i = 0; i < 4; i++){
    int res = press(chars.substr(i, 1));
    if(res) S+=chars[i];
  }
  for(int i = 0; i < N-1; i++){

    vector<string> opts;
    for(int j = 0; j < 4; j++){
      if(chars[j]==S[0]) continue;

      opts.push_back(S+chars[j]);
    }
    if(press(opts[0]+opts[1])==2*(int)S.size()){
      S=opts[2];
    }else{
      if(press(opts[0]+opts[2])==2*(int)S.size()){
        S=opts[1];
      }else S=opts[0];
    }
  }

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