# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
466804 | jazzup | 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.
#include "combo.h"
std::string guess_sequence(int N){
std::string p = "";
p="AB";
char a[3];
int m = press(p);
int c;
else if(m==1){
c=press("A");
if(c==1){
a[0]='B';
a[1]='X';
a[2]='Y';
p="A";
}
else{
a[0]='A';
a[1]='X';
a[2]='Y';
p="B";
}
}
else if(m==0){
c=press("X");
if(c==1){
a[0]='A';
a[1]='B';
a[2]='Y';
p="X";
}
else{
a[0]='A';
a[1]='B';
a[2]='X';
p="Y";
}
}
std::string S;
int x=p.length();
for(int i=x;i<N-1;i++){
S=p;
S+=a[0];
S+=a[0];
S+=p;
S+=a[0];
S+=a[1];
S+=p;
S+=a[0];
S+=a[2];
S+=p;
S+=a[1];
c=press(S);
if(c==p.length()){
p+=a[2];
}
else if(c==p.length()+1){
p+=a[1];
}
else{
p+=a[0];
}
}
S=p;
S+=a[0];
c=press(S);
if(c==p.length()+1)
return S;
else{
S=p;
S+=a[1];
c=press(S);
if(c==p.length()+1)
return S;
else{
p+=a[2];
return p;
}
}
}