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>
using namespace std;
#define dbgv(v) cout<<#v<<" = "; f(i,0,v.size()) cout<<v[i]<<" "; cout<<endl
#define dbga(a,x,y) cout<<#a<<" = "; f(i,x,y) cout<<a[i]<<" "; cout<<endl
#define erorp(x) cout<<#x<<"={"<<x.F<<" , "<<x.S<<"}"<<endl
#define eror(x) cout<<#x<<'='<<(x)<<endl
#define f_(i,a,b) for(int i=a;i>=b;i--)
#define f(i,a,b) for(int i=a;i<b;i++)
#define nb(x) __builtin_popcount(x)
#define all(v) v.begin(),v.end()
#define bit(n,k) (((n)>>(k))&1)
#define Add(x,y) x=(x+y)%mod
#define maxm(a,b) a=max(a,b)
#define minm(a,b) a=min(a,b)
#define lst(x) x[x.size()-1]
#define sz(x) int(x.size())
#define mp make_pair
#define ll long long
#define pb push_back
#define S second
#define F first
int n;
string s;
vector<char> chr;
string guess_sequence(int _n) {
string ans;
n=_n;
chr.pb('X'),chr.pb('Y'),chr.pb('A'),chr.pb('B');
f(i,0,3){
string p;
p+=chr[i];
if(press(p)>0){
ans+=chr[i];
chr.erase(chr.begin()+i);
break;
}
}
if(ans.size()==0) ans+=chr.back(),chr.pop_back();
f(i,1,n-1){
string p=ans+chr[1];
f(j,0,3) p=p+ans+chr[2]+chr[j];
ans+=chr[press(p)-i];
}
if(press(ans+chr[0])==n) ans+=chr[0];
else if(press(ans+chr[1])==n) ans+=chr[1];
else ans+=chr[2];
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |