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>
const std::string KEYS = "ABXY";
std::string guess_sequence(int n) {
char ban = ' ';
std::string ans;
auto which = [&] (void) -> char {
for (int i = 0; i < 3; i += 1) if (KEYS[i] != ban and press(ans + KEYS[i]) == (int) ans.size() + 1)
return KEYS[i];
return KEYS[3];
};
for (int i = 0; i < n; i += 1) {
char c = which();
if (not i)
ban = c;
ans += c;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |