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<bits/stdc++.h>
using namespace std;
int st;
string t="ABXY";
string guess_sequence(int N) {
string p = "";
for (int i=0; i<4; i++) {
p+=t[i];
int c=press(p);
if(c){
st=i;
break;
}
p="";
}
for(int i=1; i<N; i++){
string q="";
int x=0;
if(x==st)x++;
for(int j=0; j<4; j++){
if(st==j)continue;
q+=p+t[j]+t[j];
}
x++;
if(x==st)x++;
q+=p+t[x];
x++;
int c=press(q);
if(c==3)p+=q[p.size()];
else if(c==2)p+=q[q.size()-1];
else p+=t[x];
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |