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 "combo.h"
using namespace std;
#define in ({int x=0;int c=getchar(),n=0;for(;!isdigit(c);c=getchar()) n=(c=='-');for(;isdigit(c);c=getchar()) x=x*10+c-'0';n?-x:x;})
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int l,int r){return l+rng()%(r-l+1);}
#define fasty ios_base::sync_with_stdio(false),cin.tie(nullptr);
#define task "TASK"
#define forinc(a,b,c) for(int a=b,_c=c;a<=_c;++a)
#define fordec(a,b,c) for(int a=b,_c=c;a>=_c;--a)
#define forv(a,b) for(auto&a:b)
#define fi first
#define se second
#define pb push_back
#define ii pair<int,int>
#define mt make_tuple
#define all(a) a.begin(),a.end()
#define reset(f, x) memset(f, x, sizeof(f))
#define bit(x,i) ((x>>(i-1))&1)
#define on(x,i) (x|(1ll<<(i-1)))
#define off(x,i) (x&~(1<<(i-1)))
string guess_sequence(int N){
string st;
st=press("AB") ? press("A") ? "A" : "B" : press("X") ? "X" : "Y";
string moves="ABXY";
string ind;
forv(i,moves) if(i!=st[0]) ind.pb(i);
forinc(i,2,N-1){
int ret=press(st+ind[0]+ind[0]+st+ind[0]+ind[1]+st+ind[0]+ind[2]+st+ind[1]);
st+=ret==i ? ind[1] : ret==i+1 ? ind[0] : ind[2];
}
if(N>1) st+=press(st+ind[0]+st+ind[1]) == N ? press(st+ind[0]) == N ? ind[0] : ind[1] : ind[2];
return st;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |