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 a;
string ex;
for(int i=0;i<N;i++){
if(!i){
if(press("AB")){
if(press("A")){
a+="A";
ex="BXY";
}
else {
a+="B";
ex="AXY";
}
}
else if(press("X")){
a+="X";
ex="ABY";
}
else {
a+="Y";
ex+="ABX";
}
}
else if(i==N-1){
if(press(a+ex[0])==i+1){a+=ex[0];}
else if(press(a+ex[1])==i+1){a+=ex[1];}
else {a+=ex[2];}
}
else{
int p=press(a+ex[0]+ex[0]+a+ex[0]+ex[1]+a+ex[0]+ex[2]+a+ex[1]);
if(p==i+2){a+=ex[0];}
else if(p==i+1){a+=ex[1];}
else {a+=ex[2];}
}
}
return a;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |