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 "combo.h"
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;
char w;
void go ()
{
string s;
s+='A';
if(press(s)){
w='A';return;
}
s[0]='B';
if(press(s)){
w='B';return;
}
s[0]='X';
if(press(s)){
w='X';return;
}
s[0]='Y';
if(press(s)){
w='Y';return;
}
}
string guess_sequence(int n) {
go();
string s;
for(int i=0;i<n;i++)s+=w;
int re=1;
for(int i=1;i<n;i++)
{
re=i;
int x=re;
s[i]='A';
x=press(s);
if(x>re)continue;
s[i]='B';
x=press(s);
if(x>re)continue;
s[i]='X';
x=press(s);
if(x>re)continue;
s[i]='Y';
x=press(s);
if(x>re)continue;
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |