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 "combo.h"
#include <bits/stdc++.h>
std::string guess_sequence(int n) {
using namespace std;
string x, s;
int a = press("AB");
if (a >= 1) {
a = press("A");
if (a) x = "BXY", s = "A";
else x = "AXY", s = "B";
} else {
if (press("X")) x = "ABY", s = "X";
else x = "ABX", s = "Y";
}
for (int i = 1; i < n - 1; ++i) {
a = press(s + x[0] + s + x[1] + x[0] + s + x[1] + x[1] + s + x[1] + x[2]);
if (a == 0 + i) s += x[2];
if (a == 1 + i) s += x[0];
if (a == 2 + i) s += x[1];
}
if (n > 1) {
a = press(s + x[0]);
if (a == n) s += x[0];
else {
a = press(s + x[1]);
if (a == n) s += x[1];
else s += x[2];
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |