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