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 <iostream>
using namespace std;
string guess_sequence(int N) {
string S = "";
int coins = press("AB");
if (coins==0) {
coins = press("X");
if (coins==0) {
S+= 'Y';
} else {
S+= 'X';
}
} else {
coins = press("A");
if (coins ==0) {
S+='B';
} else {
S+='A';
}
}
for (int i = 1; i < N; ++i) {
int coins = press(S+'A'+S+'B');
if (coins>i) {
coins=press(S+'A');
if (coins>i) {
S+='A';
} else {
S+='B';
}
} else {
coins=press(S+'X');
if (coins > i) {
S+='X';
} else {
S+='Y';
}
}
}
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |