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<algorithm>
using namespace std;
string guess_sequence(int N){
string s, c = "ABXY";
int i, t, coin;
if(press("AB")){
if(press("A")) {
s += "A";
swap(c[0],c[3]);
} else {
s += "B";
swap(c[1],c[3]);
}
} else {
if(press("X")){
s += "X";
swap(c[2],c[3]);
} else {
s += "Y";
}
} coin = 1;
for(i=1;i<N-1;i++){
t = press(s+c[0]+s+c[1]+c[0]+s+c[1]+c[1]+s+c[1]+c[2]) - coin;
if(t == 0){
s += c[2];
} else if(t == 1){
s += c[0];
} else {
s += c[1];
}
coin++;
}
if(press(s+c[0]) == coin+1) s += c[0];
else if(press(s+c[1]) == coin+1) s += c[1];
else s += c[2];
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |