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;
#define all(v) v.begin(), v.end()
typedef long long ll;
string str;
int x;
string guess_sequence(int n){
x = press("AB");
string S;
if(x == 1){
x = press("A");
S = x ? "A" : "B";
}
else{
x = press("X");
S = x ? "X" : "Y";
}
for(char c : "ABXY")
if(c && c != S[0]) str += c;
for(int i = 1; i < n - 1; i++){
string s = S + str[0] + S + str[1] + str[0] + S + str[1] + str[1] + S + str[1] + str[2];
x = press(s);
if(x == i) S += str[2];
else if(x == i + 1) S += str[0];
else str += str[1];
}
x = press(S + str[0]);
if(x == n) S += str[0];
else{
x = press(S + str[1]);
if(x == n) S += str[1];
else S += str[2];
}
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |