# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
123053 | khulegub | 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<bits/stdc++.h>
using namespace std;
string butt[] = {"A", "B", "X", "Y"};
string guess_sequence(int N) {
int f;
string S = "";
if(press("A")) f = 0;
else if(press("B")) f = 1;
else if(press("X")) f = 2;
else f = 3;
S = butt[f];
string asky = s + butt[(f + 1) % 4]
asky += s + butt[(f + 2) % 4] + butt[(f + 1) % 4];
asky += s + butt[(f + 2) % 4] + butt[(f + 2) % 4];
asky += s + butt[(f + 2) % 4] + butt[(f + 3) % 4];
for (int i = 1; i < N; i++){
int x = press(asky);
int nxt;
if (x == S.length() + 1) nxt = (f + 1) % 4;
else if (x == S.length() + 2) nxt = (f + 2) % 4;
else if (x == S.length() ) nxt = (f + 3) % 4;
S += butt[nxt];
}
return S;
}