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"
using namespace std;
string guess_sequence(int N) {
string S = "", T = "";
if (press("AB") >= 1) {
if (press("A") == 1) S += 'A', T = "BXY";
else S += 'B', T = "AXY";
}
else {
if (press("X") >= 1) S += 'X', T = "ABY";
else S += 'Y', T = "ABX";
}
if (N == 1) return S;
for (int i = 1; i < N - 1; i++) {
string U = S + T[0] + T[0] + S + T[0] + T[1] + S + T[0] + T[2] + S + T[1];
int A = press(U);
if (A == i) S += T[2];
else if (A == i + 1) S += T[1];
else S += T[0];
}
if (press(S + T[0]) == N) S += T[0];
else if (press(S + T[1]) == N) S += T[1];
else S += T[2];
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |