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"
#include <string>
#include <vector>
using namespace std;
std::string guess_sequence(int N) {
vector<char> but = {'A','B','X','Y'};
string s = "";
//find first
char start='1';
for(char c : but){
if(c=='Y'){
s.push_back(c);
start=c;
break;
}
if(press(string(1,c))==1){
s.push_back(c);
start=c;
break;
}
}
for(int i=1;i<N;i++){
for(char c:but){
if(c==start){
continue;
}
if(c=='Y' || (start=='Y' && c=='X')){
s.push_back(c);
break;
}
if(c)
s.push_back(c);
if(press(s)>i){
break;
}
s.pop_back();
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |