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;
string guess_sequence(int N) {
string s = "";
string d = "";
if (press("AB")) {
if (press("A")) {
s = "A";
d = "BXY";
}
else {
s = "B";
d = "AXY";
}
}
else {
if (press("X")) {
s = "X";
d = "ABY";
}
else {
s = "Y";
d = "ABX";
}
}
for (int i = 1; i < N-1; i++) {
string p = s+d[0]+d[0]+s+d[0]+d[1]+s+d[0]+d[2]+s+d[1];
int x = press(p);
if (x == (int)(s.size()+2)) {
s.push_back(d[0]);
}
else if (x == (int)(s.size()+1)) {
s.push_back(d[1]);
}
else {
s.push_back(d[2]);
}
}
if (press(s+d[0]) == N) {
s.push_back(d[0]);
}
else if (press(s+d[1]) == N) {
s.push_back(d[1]);
}
else {
s.push_back(d[2]);
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |