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;
string s="ABXY";
int fun(string p,int i)
{
int len=press(p+s[0]+p+s[1]);
int id=2*(len<i);
len=press(p+s[id]);
id+=(len<i);
return id;
}
string guess_sequence(int n) {
string p = "";
{
int id=fun(p,1);
p+=s[id];
if(id!=3)
swap(s[id],s[3]);
}
for(int i=2;i<n;i++){
string z="";
for(int j=0;j<3;j++)
{
z+=p+s[0]+s[j];
}
z+=p+s[1];
int len=press(z);
if(len==i+1){
p+=s[0];
} else if(len==i){
p+=s[1];
} else{
p+=s[2];
}
}
if(n>1)
{
int id=fun(p,n);
p+=s[id];
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |