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');
int id;
if(press("XY")){
if(press("X")) id=0;
else id=1;
}
else{
if(press("A")) id=2;
else id=3;
}
ans+=chr[id];
chr.erase(chr.begin()+id);
f(i,1,n-1){
string p=ans+chr[1];
f(j,0,3) p=p+ans+chr[2]+chr[j];
if(int(p.size())>4*n) eror("FUCK");
int coins=press(p);
ans+=chr[coins-i];
}
if(n>1){
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... |