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;
string a[4] = {"A", "B", "X", "Y"};
int press(string p);
string guess_sequence(int N){
int res = 0; string ans = "";
for(int i = 0; i < 3; i++){
res = press(a[i]);
if(!res) continue;
ans += a[i];
swap(a[i], a[0]);
break;
}
if(!res){
ans += a[3];
swap(a[0], a[3]);
}
for(int i = 1; i < N; i++){
res = press(ans+a[1]+ans+a[2]);
if(res == i){
ans += a[3];
continue;
}
res = press(ans+a[1]);
if(res == i){
ans += a[2];
continue;
}
ans += a[1];
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |