# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1045483 | SiliconSquared | Seats (IOI18_seats) | 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.
#include "combo.h"
using namespace std;
std::string guess_sequence(int n) {
string z;
int x;
string a,b,c,d;
if (press("AB")>0){
if (press("A")==1){
a="A";b="B";
}else{
a="B";b="A";
}
c="X";d="Y";
}else{
if (press("X")==1){
a="X";b="Y";
}else{
a="Y";b="X";
}
c="A";d="B";
}
z=a;
while (z.length()<n-1){
x=press(z+b+z+c+b+z+c+c+z+c+d);
if (x==z.length()){
z+=d;
}else if (x==z.length()+1){
z+=b;
}else{
z+=c;
}
}
if (press(z+b)==n){
return z+b;
}else if (press(z+c)==n){
return z+c;
}else{
return z+d;
}
}