# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
988698 | Mighilon | 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 <combo.h>
#include <bits/stdc++.h>
using namespace std;
string guess_sequence(int n){
string a="ABXY", b="AB", d, s;
if(!press("AB"))
d="XY";
char fc = b[0];
if(!press(string(1, fc)))
fc=b[1];
trav(c, a)
if(c!=fc)
d+=c;
s+=fc;
if(n<=1) return s;
while(sz(s)<n-1)
s+=d[press(s+d[1]+s+d[2]+d[0]+s+d[2]+d[1]+s+d[2]+d[2])-sz(s)];
if(press(s+d[0]+s+d[1])>sz(s)){
if(press(s+d[0]))
return s+d[0];
return s+d[1];
}
return s+d[2];
}