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>
using namespace std;
#define len(x) (int)x.size()
string guess_sequence(int N)
{
string B = "ABXY";
int first = 2 * !!press("XY") + !!press("BY");
string res(1, B[first]);
if (N == 1)
return res;
B.erase(B.begin() + first);
while (len(res) <= N - 2)
{
string check = res + B[1] +
res + B[2] + B[0] +
res + B[2] + B[1] +
res + B[2] + B[2];
int w = press(check) - len(res);
res += B[w];
}
return res + B[2 * press(res + B[2]) +
press(res + B[1]) - 3 * N + 3];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |