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 pi = pair<int, int>;
using pl = pair<long long, long long>;
using vi = vector<int>;
using vl = vector<long long>;
using vpi = vector<pair<int, int>>;
using vpl = vector<pair<long long, long long>>;
#define fur(i, a, b) for(ll i = a; i <= (ll)b; ++i)
#define ruf(i, a, b) for(ll i = a; i >= (ll)b; --i)
#define fr first
#define sc second
#define mp make_pair
#define pb emplace_back
#define nl "\n"
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
string guess_sequence(int N) {
char c[] = {'A', 'B', 'X', 'Y'};
string ans, cur;
if(1) {
bool flag = 0;
fur(i, 0, 2) {
char u = c[i];
cur.push_back(u);
if(press(cur) == 1) {
ans.push_back(u);
flag = 1;
break;
}
cur.pop_back();
}
if(!flag) {
ans.push_back(c[3]);
cur.push_back(c[3]);
}
}
char d[] = {'A', 'B', 'X'};
ll j = 0;
fur(i, 0, 3) {
if(ans[0] == c[i])
continue;
else
d[j++] = c[i];
}
fur(i, 1, N - 1) {
// for(auto u : d) {
bool flag = 0;
fur(j, 0, 1) {
char u = d[j];
cur.push_back(u);
if(press(cur) == i + 1) {
ans.push_back(u);
flag = 1;
break;
}
cur.pop_back();
}
if(!flag) {
ans.push_back(d[2]);
cur.push_back(d[2]);
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |