이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "combo.h"
#include <bits/stdc++.h>
#define ll long long
#define f first
#define s second
#define pii pair<ll,int>
using namespace std;
string guess_sequence(int n){
string p="";
char p1,p2,p3;
if(press("AB")){
if(press("A"))
p+='A',p1='B';
else
p+='B',p1='A';
p2='Y',p3='X';
}
else{
if(press("X"))
p+='X',p3='Y';
else
p+='Y',p3='X';
p1='A',p2='B';
}
if(n==1)
return p;
int sz=1;
for(int i=1;i<n-1;i++){
string tmp=p;
tmp+=p1+p1,tmp+=p,tmp+=p1+p2,tmp+=p,tmp+=p1+p3,tmp+=p,tmp+=p2;
int x=press(tmp);
if(x-sz==2)
p+=p1;
else if(x-sz==1)
p+=p2;
else
p+=p3;
sz=p.size();
}
if(press(p+p1)-sz)
p+=p1;
else
p+=(press(p+p2)-sz ? p2:p3);
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |