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 <bits/stdc++.h>
using namespace std;
string but = "ABXY";
string t = "";
int ff;
int press(string p);
string guess_sequence(int N) {
string res = "";
for (int i = 0; i < 4; i++) {
t = res;
t += but[i];
if (press(t)) {
res = t;
ff = i;
break;
}
}
for (int i = 1; i < N; i++) {
for (int j = 0; j < 4; j++) {
if (j == ff) continue;
t = res;
t += but[j];
if (press(t) == i + 1) {
res = t;
break;
}
}
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |