# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
764089 | Blagoj | Combo (IOI18_combo) | C++17 | 29 ms | 640 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 "combo.h"
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define all(x) x.begin(), x.end()
string guess_sequence(int N) {
string cur = "ABXY", temp = "";
char first;
if (press("AB")) {
if (press("A")) first = 'A';
else first = 'B';
}
else {
if (press("X")) first = 'X';
else first = 'Y';
}
cur.erase(find(all(cur), first));
temp += first;
if (N == 1) return temp;
while (temp.size() < N - 1) {
string t = temp + cur[0];
for (auto x : cur) t += temp + cur[1] + x;
int v = press(t);
if (v == temp.size()) temp += cur[2];
if (v == temp.size() + 1) temp += cur[0];
if (v == temp.size() + 2) temp += cur[1];
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |