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"
using namespace std;
string meow = "XYAB";
string guess_sequence(int n){
string s;
int t1 = press("AB");
if(t1 == 1){
t1 = press("A");
if(t1 == 1)s = "A";
else s = "B";
}else{
t1 = press("X");
if(t1 == 1)s = "X";
else s = "Y";
}
string p;
for(int i = 0; i < 4; i++){
if(meow[i] != s[0])p += meow[i];
}
for(int i = 2; i <= n-1; i++){
t1 = press(s+p[0]+s+p[1]+p[0]+s+p[1]+p[1]+s+p[1]+p[2]);
if(t1 == i)s += p[0];
else if(t1 == i+1)s += p[1];
else s += p[2];
}
t1 = press(s+p[0]+s+p[1]);
if(t1 == n){
t1 = press(s+p[0]);
if(t1 == 1)s += p[0];
else s += p[1];
}else{
s += p[2];
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |