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;
if(press("A")==1){
s+='A';
v.push_back('B');
v.push_back('Y');
v.push_back('X');
}
else if(press("B")==1){
s+='B';
v.push_back('A');
v.push_back('Y');
v.push_back('X');
}
else if(press("X")==1){
s+='X';
v.push_back('B');
v.push_back('Y');
v.push_back('A');
}
else{
s+='Y';
v.push_back('B');
v.push_back('A');
v.push_back('X');
}
for(int i=1;i<n;i++){
for(char i:v){
if(press(s+i)==i+1){
s+=i;
break;
}
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |