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 res = "";
bool estSuivantAB;
string guess_sequence (int nbElements)
{
estSuivantAB = press("AB") > 0;
while ((int)res.size() < nbElements) {
if (estSuivantAB) {
if (press(res+"A") == (int)res.size()+1) {
res += "A";
}
else {
res += "B";
}
}
else {
if (press(res+"X") == (int)res.size()+1) {
res += "X";
}
else {
res += "Y";
}
}
estSuivantAB = press(res+"A"+res+"B") > (int)res.size();
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |