| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1305857 | farica | Combo (IOI18_combo) | C++20 | 0 ms | 0 KiB |
//#include "combo.h"
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
using vi = vector<int>;
using pi = pair<int,int>;
string guess_sequence(int N) {
string ans = "";
int tmp = press("AB");
if(!tmp) {
tmp = press("XAXBXY");
if(tmp == 1) ans = "Y";
else ans = "X";
} else {
tmp = press("ABAXAY");
if(tmp == 1) ans = "B";
else ans = "A";
}
int prev = 1;
char c[4] = {'A', 'B', 'X', 'Y'};
for(int i=1; i<N; ++i) {
for(char ch: c) {
tmp = press(ans + ch);
if(tmp == prev+1) {
ans += ch;
++prev;
break;
}
}
}
return ans;
}
