# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
787166 | resolve100 | 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<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define pb push_back
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
string guess_sequence(int N){
char chars[] = {'A', 'B', 'X', 'Y'};
bool used[4]; for (int i = 0; i < 4; i++) used[i] = false;
string out;
for (int i = 0; i < 4; i++){
int num = press(to_string(chars[i]));
if (num){
out.pb(chars[i]);
used[i] = true;
break;
}
}
for (int i = 1; i < N; i++){
for (int j = 0; j < 4; i++){
if (used[j]) continue;
int num = press(out+chars[j]);
if (num > i){
out.pb(chars[j]);
break;
}
}
}
return out;
}