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<bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int n)
{
string s = "";
int ab = press("AB");
if(ab == 0)
{
if(press("X")) s += 'X';
else s += 'Y';
}
else
{
if(press("A")) s += 'A';
else s += 'B';
}
for(int i=2 ; i<=n ; i++)
{
string test = "";
test += s;
test += "XX";
test += s;
test += "XY";
test += s;
test += "XZ";
test += s;
test += "Y";
test += s[0];
int ret = press(test);
if(ret == 0) s += 'Z';
else if(ret == 1) s += 'Y';
else s += 'X';
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |