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"
using namespace std;
string guess_sequence(int n)
{
int res = -1;
string letters[] = {"A", "B", "Y", "X"}, start, curr;
for (auto x : letters)
{
start = x;
if (press(x) == 1)
break;
}
while ((int)curr.size() < n)
{
for (auto x : letters)
{
if (x != start)
res = press(start + x);
if (res > (int)curr.size())
{
curr += x;
break;
}
}
}
return curr;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |