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;
string guess_sequence(int N) {
string A = "";
string T = "ABXY";
int len = press(A + T[0] + A + T[1]);
int ind = 2 * (len == 0);
ind += (press(A + T[ind]) == 0);
A += T[ind];
swap(T[ind], T[3]);
for (int i = 1; i < N-1; i++) {
len = press(A+T[0]+T[0] + A+T[0]+T[1] + A+T[0]+T[2] + A+T[1]);
if (len == i+2) {
A += T[0];
} else if (len == i+1) {
A += T[1];
} else {
A += T[2];
}
}
len = press(A + T[0] + A + T[1]);
ind = 2 * (len == N-1);
ind += (press(A + T[ind]) == N-1);
A += T[ind];
return A;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |