# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
908735 | Aiperiii | Combo (IOI18_combo) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
string guess_sequence(int N) {
string s="";
string x="";
x=s;
x+='A';x+=s;x+='B';
int res1=press(x);
if(res1==1){
x=s;x+='A';
if(press(x)==1)s+='A';
else s+='B';
}
else{
x=s;x+='X';
if(press(x)==1)s+='X';
else s+='Y';
}
for(int j=1;j<N;j++){
x=s;
x+='A';x+=s;x+='B';
int res1=press(x);
if(res1==j+1){
x=s;x+='A';
if(press(x)==j+1)s+='A';
else s+='B';
}
else{
x=s;x+='X';
if(press(x)==j+1)s+='X';
else s+='Y';
}
}
return s;
}