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"
#define pb push_back
#define ll long long
#define x first
#define y second
using namespace std;
string guess_sequence(int n)
{
string ret="";
string c="";
int gt=press("AB");
if(gt)
{
gt=press("A");
if(gt) ret+="A", c="BXY";
else ret+="B", c="AXY";
}
else
{
gt=press("X");
if(gt) ret+="X", c="ABY";
else ret+="Y", c="ABX";
}
if(n==1) return ret;
for(int i=1;i<n-1;i++)
{
gt=press(ret+c[0]+c[0]+ret+c[0]+c[1]+ret+c[0]+c[2]+ret+c[1]);
if(gt==i) ret+=c[2];
else if(gt==i+1) ret+=c[1];
else ret+=c[0];
}
gt=press(ret+c[0]);
if(gt==n) return ret+c[0];
else
{
gt=press(ret+c[1]);
if(gt==n) return ret+c[1];
return ret+c[2];
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |