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 <bits/stdc++.h>
using namespace std;
#include "combo.h"
string guess_sequence(int n) {
string s;
vector<char>v;
int toto=press("AB"),toto2=press("AX"),k=1;
if(toto==1 && toto2==1){
s+='A';
v.push_back('B');
v.push_back('Y');
v.push_back('X');
}
else if(toto==0 && toto2==0){
s+='Y';
v.push_back('B');
v.push_back('A');
v.push_back('X');
}
else if(toto==2){
s+="AB";
k=2;
v.push_back('B');
v.push_back('Y');
v.push_back('X');
}
else if(toto2==2){
s+="AX";
k=2;
v.push_back('B');
v.push_back('Y');
v.push_back('X');
}
else if(toto==1){
s+='B';
v.push_back('A');
v.push_back('Y');
v.push_back('X');
}
else{
s+='X';
v.push_back('B');
v.push_back('Y');
v.push_back('A');
}
for(int i=k;i<n;i++){
for(char j:v){
if(press(s+j)==i+1){
s+=j;
break;
}
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |