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>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define F first
#define S second
#define endl '\n'
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define maxp 22
#define EPS (ld)(1e-18)
#define mod (int)(1e9+7)
/// x = press(string s) for query
string guess_sequence(int N) {
int i;
string s="";
char moves[4]={'A','B','X','Y'};
for(i=0;i<N;i++){
string p=s+moves[0];
p+=s+moves[1];
int x=press(p);
if(x==i){
p=s+moves[2];
x=press(p);
if(x==i)
s+=moves[3];
else
s+=moves[2];
}
else{
p=s+moves[0];
x=press(p);
if(x==i)
s+=moves[1];
else
s+=moves[0];
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |