# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
440283 | julian33 | 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;
#ifdef LOCAL
#define deb(...) logger(#__VA_ARGS__, __VA_ARGS__)
template<typename ...Args>
void logger(string vars, Args&&... values) {
cerr<<vars<<" = ";
string delim="";
(...,(cerr<<delim<<values,delim=", "));
cerr<<"\n";
}
#else
#define deb(...) logger(#__VA_ARGS__, __VA_ARGS__)
template<typename ...Args>
void logger(string vars, Args&&... values) {}
#endif
#define pb push_back
#define sz(x) (int)(x.size())
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<typename T> inline void maxa(T& a,T b){a=max(a,b);}
template<typename T> inline void mina(T& a,T b){a=min(a,b);}
// int press(string p){
// deb(p);
// string pref=S;
// while(sz(pref)){
// if(p.find(pref)!=string::npos){
// deb(pref);
// return sz(pref);
// }
// pref.pop_back();
// }
// return 0;
// }
string guess_sequence(int N){
string res="";
while(sz(res)!=N){
int num=press(res+'A'+res+'B');
if(num>sz(res)){
int a=press(res+'A');
if(a>sz(res))
res+='A';
else
res+='B';
} else{
int x=press(res+'X');
if(x>sz(res))
res+='X';
else
res+='Y';
}
}
return res;
}