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) {
vector<char> c = {'A', 'B', 'X', 'Y'};
string s;
if (n == 1) {
s = ".";
for (auto &i : c) {
s[0] = i;
if (press(s) == n) {
break;
}
}
} else if (n == 2) {
s = "..";
for (auto &i : c) {
for (auto &j : c) {
s[0] = i;
s[1] = j;
if (press(s) == n) {
goto done;
}
}
}
} else {
s = "...";
for (auto &i : c) {
for (auto &j : c) {
for (auto &k : c) {
s[0] = i;
s[1] = j;
s[2] = k;
if (press(s) == n) {
goto done;
}
}
}
}
}
done:
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |