# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
800606 | 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()
/*
int press(string s){
return 1;
}
*/
string guess_sequence(int N){
string ans = "";
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');
chars.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;
}
/*
main(){
int n; cin >> n;
cout << guess_sequence(n);
return 0;
}
*/