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>
#define vi vector<int>
#define gi greater<int>
#define gr greater
#define ve vector
#define ll long long
#define vf vector<float>
#define vll vector<pair<ll,ll>>
#define ii pair<int,int>
#define pll pair<ll,ll>
#define vvi vector<vi>
#define vii vector<ii>
#define gii greater<ii>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF 1e9
#define eps 1e-7
#define eps1 1e-2
#define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX_A 2e5+5
using namespace std;
const int MOD = 1e9+7;
const int nax = 1e6+5;
typedef complex<int> Point;
#define X real()
#define Y imag()
#include "combo.h"
char let[4] = {'A','B','X','Y'};
string guess_sequence(int n) {
string s = "";
int beg = 0;
if(press("A")) beg = 0,s = "A";
else if(press("B")) beg = 1,s= "B";
else if(press("X")) beg = 2,s = "X";
else beg = 3,s = "Y";
for (int i = 2; i <= n; ++i)
{
int cnt = 0;
for (int j = 0; j < 4; ++j)
{
if(beg == j) continue;
if(cnt < 2 && press(s + let[j]) == i) {
cnt++;
s += let[j];
break;
} else if(cnt == 2){
s += let[j];
}
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |