# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1194595 | Cebrayil09 | Combo (IOI18_combo) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
#define pii pair < int , int >
#define eb emplace_back
#define pb push_back
//#define int long long
#define fi first
#define se second
string guess_sequence(int n) {
char hrf[4] = {'A','B','X','Y'};
int say[4] = {0,0,0,0};
for(int i = 0;i < 4;i++) {
string s = "";
for(int j = 1;j <= n;j++) s.pb(hrf[i]);
say[i] = press(s);
}
string s = "";
for(int i = 1;i <= n;i++) {
for(int j = 0;j < 4;j++) {
if(say[j] == 0) continue;
string test = s;
test.pb(hrf[j]);
if(i == 1) {
if(say[j] == 1) {
int c = press(test);
if(c == test.size()) {
say[j]--;
s = test;
break;
}
}
continue;
}
int c = press(test);
if(c == test.size()) {
say[j]--;
s = test;
break;
}
}
}
return s;
}