# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1132239 | AMel0n | Combo (IOI18_combo) | C++20 | 0 ms | 0 KiB |
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
std::string guess_sequence(int N) {
string f;
if (press("AB") >= 1) {
if(press("B")) f = "B";
else f = "A";
} else {
if press("X") f = "X";
else f = "Y";
}
for(int i = 0; i < 4; i++) {
string one;
if (i == 0) one = "A";
else if (i == 1) one = "B";
else if (i == 2) one = "X";
else one = "Y";
string two;
for(int j = 0; j < 4; j++) {
if (j == 0) two = "A";
else if (j == 1) two = "B";
else if (j == 2) two = "X";
else two = "Y";
if (press(f + one + two) == 3) return f+one+two;
}
}
return f+one+two;
}