제출 #214862

#제출 시각아이디문제언어결과실행 시간메모리
214862tushar_2658Combo (IOI18_combo)C++14
10 / 100
104 ms576 KiB
#include "combo.h"
#include "bits/stdc++.h"
using namespace std;

string guess_sequence(int N) {
  string ans;
  ans ="A";
  int tot = press(ans);
  if(tot != 1){
    ans = "B";
    tot = press(ans);
  }
  if(tot != 1){
    ans = 'X';
    tot = press(ans);
  }
  if(tot != 1){
    ans = "Y";
    tot = press(ans); 
  }
  string ss = "ABXY";
  for(int i = 1; i < N; i++){
    int need = tot + 1;
    for(int j = 0; j < 4; j++){
      if(j == 0){
        ans += ss[j];
        tot = press(ans);
      }
      if(tot == need)break;
      else if(j > 0){
        ans[i] = ss[j];
        tot = press(ans);
      }
    }
  }
  return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...