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) {
vector<string> v = {"X", "Y", "A", "B"};
string ans;
if(press(v[0] + v[1])) {
if(press(v[0])) {
ans = v[0];
} else {
ans = v[1];
}
} else {
if(press(v[2])) {
ans = v[2];
} else {
ans = v[3];
}
}
v.erase(find(begin(v), end(v), ans));
for(int i = 2; i < N; ++i) {
ans += v[i + 1 - press(ans + v[0] + v[0] + ans + v[0] + v[1] + ans + v[0] + v[2] + ans + v[1])];
}
if(press(ans + v[0] + ans + v[1]) == N) {
if(press(ans + v[0]) == N) {
ans += v[0];
} else {
ans += v[1];
}
} else {
ans += v[2];
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |