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 all = "ABXY";
string guess_sequence(int n) {
string res; int beg = -1;
if (press("AB")) {
if (press("A")) beg = 0;
else beg = 1;
} else {
if (press("X")) beg = 2;
else beg = 3;
}
res += all[beg];
char x = all[(beg+1)%4], y = all[(beg+2)%4], z = all[(beg+3)%4];
for (int i=2; i<n; i++) {
int tmp = press(res+x + res+y+x + res+y+y + res+y+z);
if (tmp == i-1) res += z;
else if (tmp == i) res += x;
else res += y;
}
if (press(res+x) == n) res += x;
else if (press(res+y) == n) res += y;
else res += z;
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |