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;
vector<char> ca {'A', 'B', 'X', 'Y'};
string guess_sequence (int n) {
string ans;
for (int i = 0; i < 4; ++i) {
if (i == 3 || press(ans + ca[i])) {
ans += ca[i];
ca.erase(ca.begin() + i);
break;
}
}
for (int i = 1; i < n; ++i) {
for (int j = 0; j < 3; ++j) {
if (j == 2 || press(ans + ca[j]) == i + 1) {
ans += ca[j];
break;
}
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |