# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
135965 | neki | 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 "combo.h"
#include <bits/stdc++.h>
#define loop(i, a, b) for(int i=a;i<b;i++)
using namespace std;
vector<string>zn={"A", "B", "X", "Y"};
std::string guess_sequence(int N) {
int st;
vector<int> ost;
loop(i, 0, 4){
if(press(zn[i])) st=i;
else ost.push_back(i);
}
string ans=zn[st];
if(N==1) return ans;
loop(i, 1, N-1){
string ask=ans+zn[ost[0]]+ans+zn[ost[1]]+zn[ost[0]]+ans+zn[ost[1]]+zn[ost[1]]+ans+zn[ost[1]]+zn[ost[2]];
int res=press(ask);
if(res==ans.length()) ans+=zn[ost[2]];
else if(res==ans.length()+1) ans+=zn[ost[0]];
else ans+=zn[ost[1]];
}
loop(i, 0, 3){
if(press(ans+zn[ost[i]])==ans.length()+1) return ans+zn[ost[i]];
}
}
int main(){
return 0;
}