#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
#define popcount(n) __builtin_popcountll(n)
#define clz(n) __builtin_clzll(n)
#define print(a) cerr << "[" << #a << " = " << (a) << "] "
#define dbg(a) cerr << __LINE__ << ": "; print(a); cerr << "\n"
#define sz(a) (int)((a).size())
string guess_sequence(int n) {
vector<string> v = {"A", "B", "X", "Y"};
int cnt = 0;
string s = "";
for (auto x : v) {
if (cnt == 3) break;
if (press(x)) {
s = x;
break;
}
++cnt;
}
if (s == "") s = "Y";
vector<string> nv;
for (auto x : v) {
if (x == s) continue;
nv.push_back(x);
}
v = nv;
// dbg(s);
for (int i = 1; i < n; ++i) {
int cnt = 0;
for (auto x : v) {
if (cnt == 2) break;
if (press(s + x) == sz(s) + 1) {
s += x;
break;
}
}
if (sz(s) == i) s += v.back();
// dbg(s);
}
return s;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |