Submission #763872

#TimeUsernameProblemLanguageResultExecution timeMemory
763872ind1vCombo (IOI18_combo)C++11
30 / 100
37 ms580 KiB
#include <bits/stdc++.h>
#include "combo.h"

using namespace std;

string guess_sequence(int n) {
  string ans;
  for (int i = 1; i <= n; i++) {
    string cope = ans + 'A' + ans + 'B';
    int d = press(cope);
    if (d >= i) {
      cope = ans + 'A';
      d = press(cope);
      if (d >= i) {
        ans += 'A';
      } else {
        ans += 'B';
      }
    } else {
      cope = ans + 'X';
      d = press(cope);
      if (d >= i) {
        ans += 'X';
      } else {
        ans += 'Y';
      }
    }
  }
  return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...