#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
string ret;
vector<char> valid;
if (press("AB"))
{
if (press("A"))
{
ret += 'A';
valid = {'B', 'X', 'Y'};
}
else
{
ret += 'B';
valid = {'A', 'X', 'Y'};
}
}
else
{
if (press("X"))
{
ret += 'X';
valid = {'A', 'B', 'Y'};
}
else
{
ret += 'Y';
valid = {'A', 'B', 'X'};
}
}
// int curr = 2;
for (int i = 1; i < N; ++i)
{
ret += '.';
for (char c : valid)
{
ret[i] = c;
if (press(ret) == i + 1) break;
}
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |