이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int n){
char all[4];
int fake=press("AB");
if(fake==0){
fake=press("X");
if(fake==0){
all[0]='Y';
all[1]='A';
all[2]='B';
all[3]='X';
}
else{
all[0]='X';
all[1]='A';
all[2]='Y';
all[3]='B';
}
}
else{
fake=press("A");
if(fake==1){
all[0]='A';
all[1]='B';
all[2]='X';
all[3]='Y';
}
else{
all[0]='B';
all[1]='A';
all[2]='X';
all[3]='Y';
}
}
string res;
int unnow=1;
res.push_back(all[0]);
int now=2;
for(;now<n;){
unnow=now-1;
fake=press(res+all[1]+all[1]+res+all[1]+all[2]+res+all[2]+all[1]);
if(fake==unnow){
res+=all[3];
now++;
continue;
}
else if(fake==unnow+1){
fake=press(res+all[2]+all[2]);
if(fake==unnow+2){
res+=all[2];
res+=all[2];
now+=2;
continue;
}
if(fake==unnow+1){
res+=all[2];
res+=all[3];
now+=2;
continue;
}
res+=all[1];
res+=all[3];
now+=2;
continue;
}
else{
fake=press(res+all[1]+all[1]);
if(fake==unnow){
res+=all[2];
res+=all[1];
now+=2;
continue;
}
else if(fake==unnow+1){
res+=all[1];
res+=all[2];
now+=2;
continue;
}
else{
res+=all[1];
res+=all[1];
now+=2;
continue;
}
}
}
if(now==n){
fake=press(res+all[1]+res+all[2]);
if(fake==n){
fake=press(res+all[1]);
if(fake==n){
res+=all[1];
}
else{
res+=all[2];
}
}
else{
res+=all[3];
}
}
return res;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |