#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
string all = "ABXY";
string p = "";
// Step 1: find the first character
for (char c : all) {
if (press(string(1, c)) == 1) {
p += c;
break;
}
}
// Step 2: find the rest
for (int i = 1; i < N; ++i) {
for (char c : all) {
if (c == p[0]) continue; // skip already used first char
string tryStr = p + c;
if (press(tryStr) == i + 1) {
p += c;
break;
}
}
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |