# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
701019 | BobCompetitiveProgramming | 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>
using namespace std; using ll=long long;
/*
int press(string s){
cout << " IN PRESS, ans with string s = " << s << endl;
ll ret; cin>>ret;
return ret;
}
*/
string guess_sequence(int N){
string S = "", first;
vector<string> buttons{"A", "B", "X", "Y"};
for(auto& button : buttons)
if(press(button))
first = button, S += button;
while(true){
if(S.size() == N)
return S;
for(auto& button : buttons)
if(button != first && press(S + button) > S.size())
S += button;
}
}
/*
int main(){
guess_sequence(5);
}
*/