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"
std::string guess_sequence(int N) {
std::string curr,r;
int t;
if(press("A")) {curr="A";r="BXY";}
else if(press("B")) {curr="B";r="AXY";}
else if(press("X")) {curr="X";r="ABY";}
else {curr="Y";r="AXB";}
for(int i=2;i<N;i++)
{
t=press(curr+r[0]+r[0]+curr+r[0]+r[1]+curr+r[0]+r[2]+curr+r[1]);
if(t==i) curr+=r[1];
else if(t==i+1) curr+=r[0];
else curr+=r[2];
}
if(N>1){
if(press(curr+r[0])==N) curr+=r[0];
else if(press(curr+r[1])==N) curr+=r[1];
else curr+=r[2];
}
return curr;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |