# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1219713 | melody_rules | Combo (IOI18_combo) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "combo.h"
#define int long long
using namespace std;
string guess_sequence(int N) {
string p = "";
string S = "";
while(true) {
string q;
q = p;
p += "A";
if(press(p) == p.length() && p.length() == N)
break;
else if(press(p) == p.length())
continue;
p = q;
p += "B";
if(press(p) == p.length() && p.length() == N)
break;
else if(press(p) == p.length())
continue;
p = q;
p += "X";
if(press(p) == p.length() && p.length() == N)
break;
else if(press(p) == p.length())
continue;
p = q;
p += "Y";
if(p.length() == N)
break;
}
return p;
}