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;
using ll = long long;
string guess_sequence(int N) {
string Q = "ABXY";
string f;
if ( press("AB") >= 1) {
if ( press("A") == 1) f = "A";
else f = "B";
}
else {
if ( press("X") == 1) f = "X";
else f = "Y";
}
string dused = "";
if ( f != "X") dused += "X";
if ( f != "Y") dused += "Y";
if ( f != "A") dused += "A";
if ( f != "B") dused += "B";
string str;
for (int i = 1; i < N; ++i) {
if ( i + 1 == N) {
str = f + dused[0] + f + dused[1];
if ( press(str) == i + 1) {
str = f + dused[0];
if ( press(str) == i) f += dused[1];
else f += dused[0];
}
else {
f += dused[2];
}
break;
}
str = f + dused[0];
str += string(f + dused[1] + dused[0]);
str += string(f + dused[1] + dused[1]);
str += string(f + dused[1] + dused[2]);
int X = press(str);
if ( X == i) {
f += dused[2];
}
else {
if ( X== i + 1) {
f += dused[0];
}
else {
f += dused[1];
}
}
}
return f;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |