This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
string s = "";
char v[] = {'A', 'B', 'X', 'Y'}; int x;
if (press("AB")) {
x = press("A") != 1;
} else {
x = (press("X") ? 2 : 3);
}
s += v[x];
swap(v[x], v[3]);
for (int i = 1; i < N - 1; ++i) {
x = press(s + v[0] + v[0] + s + v[0] + v[1] + s + v[0] + v[2] + s + v[1]);
if (x == i + 2) s += v[0];
else if (x == i + 1) s += v[1];
else s += v[2];
}
if (press(s + v[0] + s + v[1]) == N) {
if (press(s + v[0]) == N) s += v[0];
else s += v[1];
} else s += v[2];
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |