# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
867761 | lalig777 | Combo (IOI18_combo) | C++14 | 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 <iostream>
#include <vector>
using namespace std;
string guess sequence(int N){
string S="";
char l1='A', l2='B', l3='X';
if (press("A")==1){
S+='A';
l1='Y';
}else if (press("B")==1){
S+='B';
l2='Y';
}else if (press("X")==1){
S+='X';
l3='Y';
}else S+='Y';
for (int i=1; i<N; i++){
string p="";
p=S+l1+l1+S+l1+l2+S+l1+l3+S+l2;
int x=press(p);
if (x==i) S+=l3;
else if (x==i+1) S+=l2;
else S+=l1;
}return S;
}