Submission #553635

#TimeUsernameProblemLanguageResultExecution timeMemory
553635ITOCombo (IOI18_combo)C++11
100 / 100
35 ms612 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;

std::string guess_sequence(int N) {
  string al = "ABXY", t[3], s = {al[(press("XY") ? 2 : 0) + (press("BY") ? 1 : 0)]};
  int ii = 0;
  for (char cc : al) if (cc != s[0]) t[ii++].push_back(cc);
  for (int i = 1; i < N - 1; i++) {
    s.push_back(t[press(s + t[1] + s + t[2] + t[0] + s + t[2] + t[1] + s + t[2] + t[2]) - i][0]);
  }
  if (N != 1) {
    s.push_back(t[(press(s + t[2]) == N ? 2 : (press(s + t[1]) == N ? 1 : 0))][0]);
  }
  return s;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...