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 guess_sequence(int N) {
string res = "";
int id = 0;
string c = "ABXY";
if(press(res + c[0]) == 1) id = 0;
else if(press(res + c[1]) == 1) id = 1;
else if(press(res + c[2]) == 1) id = 2;
else id = 3;
res += c[id];
swap(c[3], c[id]);
for(int i = 1; i < N - 1; ++i){
int v = press(res + c[0] + c[0] + res + c[0] + c[1] + res + c[0] + c[2] + res + c[1]);
if(v == i + 2) {
res += c[0];
}else if(v == i + 1){
res += c[1];
}else res += c[2];
}
if(press(res + c[0]) == N) res += c[0];
else if(press(res + c[1]) == N) res += c[1];
else res += c[2];
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |