# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
686916 | viwlesxq | Combo (IOI18_combo) | C++17 | 0 ms | 0 KiB |
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>
using namespace std;
typedef int64_t ll;
typedef string str;
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) (int)x.size()
string guess_sequence(int N) {
str res;
vector <char> v;
if (!press("X")) v.pb('X');
else res += 'X';
if (!press("Y")) v.pb('Y');
else res += 'Y';
if (!press("A")) v.pb('Y');
else res += 'A';
if (!press("B")) v.pb('B');
else res += 'B';
for (int i = 1; i < N; i++) {
for (str ask : v) {
if (press(res + ask) == i + 1) {
res += ask;
break;
}
}
}
return res;
}