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")) {
if (press("A")) t = "BXY", s = "A";
else t = "AXY", s = "B";
} else {
if (press("X")) t = "ABY", s = "X";
else t = "ABX", s = "Y";
}
for (int i = 1; i < n - 1; i++) {
s += t[press(s + t[1] + s + t[2] + t[0] + s + t[2] + t[1] + s + t[2] + t[2]) - s.size()];
}
if(n == 1) return s;
if(press(s + t[0]) == n) return s + t[0];
if(press(s + t[1]) == n) return s + t[1];
return s + t[2];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |