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<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<ll, ll>
#define ff first
#define ss second
#define pb push_back
#define ld long double
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
string a[4] = {"A", "B", "X", "Y"};
int press(string p);
string guess_sequence(int N){
int res; string ans = "";
for(int i = 0; i < 3; i++){
res = press(a[i]);
if(res){
ans += a[i];
swap(a[i], a[0]);
break;
}
}
if(!res){
ans = a[3]; swap(a[3], a[0]);
}
for(int i = 1; i < N; i++){
res = press((ans+a[1]+a[2]));
if(res == i){
ans += a[3];
} else if(res == i+1){
ans += a[1];
} else if(res == i+2){
ans += a[1];
ans += a[2];
i++;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |