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>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include "combo.h"
using namespace std;
using namespace __gnu_pbds;
#define watch(x) cout<<(#x)<<"="<<(x)<<'\n'
#define mset(d,val) memset(d,val,sizeof(d))
#define setp(x) cout<<fixed<<setprecision(x)
#define forn(i,a,b) for(int i=a;i<b;i++)
#define fore(i,a,b) for(int i=a;i<=b;i++)
#define pb push_back
#define F first
#define S second
#define INF 2e14
#define MOD 998244353
#define pqueue priority_queue
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
#define MAXN 100005
vector<string> c = {"A","B","X","Y"};
string guess_sequence(int n){
string ans="";
int res;
int beg;
res=press(c[0]+c[1]);
if(res){
res=press(c[0]);
if(res) beg=0;
else beg=1;
}
else{
res=press(c[2]);
if(res) beg=2;
else beg=3;
}
ans+=c[beg];
c.erase(c.begin()+beg);
if(n==1) return ans;
forn(i,1,n-1){
string p=ans+c[0];
forn(j,0,3){
p+=ans+c[1]+c[j];
}
int res=press(p);
if(res==i+1) ans+=c[0];
else if(res==i+2) ans+=c[1];
else ans+=c[2];
}
res=press(ans+c[0]+ans+c[1]);
if(res==n){
if(press(ans+c[0])==n) return ans+c[0];
else return ans+c[1];
}
return ans+c[2];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |