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"
#include<iostream>
using namespace std;
std::string guess_sequence(int n) {
string r, oth;
if(press("XY")>0){
if(press("X")==1){r="X"; oth ="ABY";}
else {r="Y"; oth="ABX";}}
else if(press("A")==1){r="A"; oth="XYB"; }
else {r="B"; oth="XYA";}
for(int i=2;i<n;i++)
{
long long br=press(r+oth[2]+oth[0]+r+oth[2]+oth[1]+r+oth[2]+oth[2]+r+oth[1]);
if(br==i+1)r=r+oth[2];
if(br==i)r=r+oth[1];
else if(br==i-1)r=r+oth[0];
}
if(n>1)
{
if(press(r+oth[2])==n)r=r+oth[2];
else if(press(r+oth[1])==n)r=r+oth[1];
else r=r+oth[0];
}
return r;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |