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 <bits/stdc++.h>
# include "combo.h"
using namespace std;
string guess_sequence(int n) {
string s, t;
if ( press("A") ) {
s = "A";
t = "BXY";
}
else if ( press("B") ) {
s = "B";
t = "AXY";
}
else if ( press("X") ) {
s = "X";
t = "ABY";
}
else {
s = "Y";
t = "ABX";
}
if ( n == 1 ) {
return s;
}
int cur = 1;
for ( int i = 1; i < n - 1; i++ ) {
string k = s;
k += t[0];
for ( int j = 0; j < 3; j++ ) {
k += s + t[1] + t[j];
}
int get = press(k);
if ( get == cur ) {
s += t[2];
}
else if ( get == cur + 1 ) {
s += t[0];
}
else {
s += t[1];
}
cur++;
}
if ( press( s + t[0] ) == cur + 1 ) {
s += t[0];
}
else if ( press( s + t[1] ) == cur + 1 ) {
s += t[1];
}
else {
s += t[2];
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |