# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
800604 | iskhakkutbilim | 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;
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
string guess_sequence(int N){
string ans = "";
char chars[4] = {'A', 'B', 'X', 'Y'};
if(press("A") == 1){
ans.push_back('A');
}else if(press("B") == 1){
ans.push_back('B');
}else if(press("X") == 1){
ans.push_back('X');
}else{
ans.push_back('Y');
}
set<char> chars;
chars.insert('A');
chars.insert('B');
chars.insert('X');
chars.insert('Y');
st.erase(ans[0]);
for(int i = 2;i <= N; i++){
for(char ch : chars){
if(press(ans+ch) == i){
ans.push_back(ch);
break;
}
}
}
if((int)ans.size() != N) assert(false);
return ans;
}