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 res = "";
vector<char> vec = {'A', 'B', 'X'};
if(press("AB") >= 1) {
if(press("A") == 1) {
res += 'A';
vec.erase(vec.begin());
}
else {
res += 'B';
vec.erase(vec.begin() + 1);
}
}
else {
if(press("X") == 1) {
res += 'X';
vec.erase(vec.begin() + 2);
}
else {
res += 'Y';
}
}
for(int i = 2; i <= N; i++) {
bool flag = false;
for(auto e : vec) if(press(res + e) == i) {
res += e;
flag = true;
break;
}
if(flag) continue;
res += 'Y';
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |