# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
534339 | MrDeboo | Combo (IOI18_combo) | C++17 | 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 "combo.h"
#include <bits/stdc++.h>
// #define int long long
using namespace std;
std::string guess_sequence(int n) {
char f[]={"A","B","X","Y"};
string s;
for(auto &i:f){
string g;
g+=i;
if(press(g)!=0){s+=i;break;}
}
vector<char>v;
for(auto &i:f)if(i!=s[0])v.push_back(i);
for(int i=1;i<n;i++){
bool bl=0;
for(int w=0;w<2;w++){
if(press(s+v[w])==i+1){
s+=v[w];
bl=1;
break;
}
}
if(!bl)s+=v.back();
}
return s;
// std::string p = "";
// for (int i = 0; i < 4 * N; ++i) {
// p += 'A';
// }
// int coins = press(p);
// std::string S = "";
// for (int i = 0; i < N; ++i) {
// S += 'A';
// }
// return S;
}