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 <bits/stdc++.h>
using namespace std;
std::string guess_sequence(int N) {
std::string p = "";
string v,S;
if(press("A")==1){
S="A";
v="BXY";
}
else if(press("B")==1){
S="B";
v="AXY";
}
else if(press("X")==1){
S="X";
v="ABY";
}
else{
S="Y";
v="ABX";
}
for(int i=1;i<N;i++){
bool ok=0;
for(int j=0;j<=1;j++){
p=S;
p+=v[j];
if(press(p)>i){
ok=1;
S=p;
break;
}
}
if(!ok) S+=v[2];
}
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |