# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
254589 | Erkhemkhuu | Combo (IOI18_combo) | C++17 | 1 ms | 212 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>
#include <combo.h>
using namespace std;
#define ll long long
#define pb push_back
#define mk make_pair
#define F first
#define S second
string guess_sequence(int n) {
string res, seq;
int i;
if(press("AB")) {
if(press("B")) {
res = "B";
seq = "AXY";
}
else {
res = "A";
seq = "BXY";
}
}
else {
if(press("X")) {
res = "X";
seq = "ABY";
}
else {
res = "Y";
seq = "ABX";
}
}
if(n == 1) return res;
for(i = 1; i < n - 1; i++) {
string temp = "";
temp = res + seq[0];
temp += res + seq[1] + seq[0];
temp += res + seq[1] + seq[1];
temp += res + seq[1] + seq[2];
int ret = press(temp);
if(ret == res.size() + 1) res += seq[0];
else if(ret == res.size() + 2) res += seq[1];
else res += seq[2];
}
string temp = "";
temp = res + seq[0] + res + seq[1];
if(press(temp) == n) {
temp += res + seq[0];
if(press(temp) == n) res += seq[0];
else res += seq[1];
}
else res += seq[2];
return res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |