이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |