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 G = "ABXY", I;
string guess_sequence(int N) {
int fir = 3;
for (int i = 0; i < 3; i++) {
int F = press(G.substr(i, 1));
if (F == 1) fir = i;
}
string S = G.substr(fir, 1);
for (int i = 0; i < 4; i++) { if (i != fir) I.push_back(G[i]); }
for (int i = 1; i < N; i++) {
int sec = 2;
for (int j = 0; j < 2; j++) {
int F = press(S + I.substr(j, 1));
if (F > i) sec = j;
}
S += I.substr(sec, 1);
}
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |