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 <string>
#include "combo.h"
#include <iostream>
using namespace std;
string guess_sequence(int N)
{
int ab = press("AB");
char first;
if (ab > 0)
{
if (press("A") > 0)
{
first = 'A';
}
else
{
first = 'B';
}
}
else
{
if (press("X") > 0)
{
first = 'X';
}
else
{
first = 'Y';
}
}
string p = "";
p += first;
for (int i = 1; i < N; i++)
{
int m;
p = p + 'A';
if (first != 'A')
{
m = press(p);
if (m > i)
{
continue;
}
}
if (first != 'B')
{
p[i] = 'B';
m = press(p);
if (m > i)
{
continue;
}
}
if (first != 'X')
{
p[i] = 'X';
m = press(p);
if (m > i)
{
continue;
}
}
p[i] = 'Y';
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |