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;
std::string guess_sequence(int N) {
string s = "";
vector<char> c{'A', 'B', 'X', 'Y'};
for (auto &e: c) {
string p; p.push_back(e);
if (press(p)) {s = p; break;}
}
for (int i = 2; i <= N; i++) {
for (auto &e: c) {
if (e != s.front()) {
string p = s; p.push_back(e);
if (press(p) == i) {s = p; break;}
}
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |