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;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
#define ins insert
vector<string> f = {"A", "B", "X", "Y"};
string guess_sequence(int n){
int x; string s;
if (press("AB")){
if (press("A")){
x = 0; s = "A";
}
else {
x = 1; s = "B";
}
}
else {
if (press("X")){
x = 2; s = "X";
}
else {
x = 3; s = "Y";
}
}
if (n == 1) return s;
f.erase(f.begin() + x);
for (int i = 1; i < n - 1; i++){
string p = s + f[1];
for (int j = 0; j < 3; j++){
p += (s + f[2] + f[j]);
}
int k = press(p) - (int) s.size();
s += f[k];
}
string p = s + f[0];
if (press(p) == n){
s += f[0];
}
else {
p = s + f[1];
if (press(p) == n){
s += f[1];
}
else {
s += f[2];
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |