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;
std::string guess_sequence(int N) {
string al = "ABXY", t[3], s = {al[(press("XY") ? 2 : 0) + (press("BY") ? 1 : 0)]};
int ii = 0;
for (char cc : al) if (cc != s[0]) t[ii++].push_back(cc);
for (int i = 1; i < N - 1; i++) {
s.push_back(t[press(s + t[1] + s + t[2] + t[0] + s + t[2] + t[1] + s + t[2] + t[2]) - i][0]);
}
if (N != 1) {
s.push_back(t[(press(s + t[2]) == N ? 2 : (press(s + t[1]) == N ? 1 : 0))][0]);
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |