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;
template <typename T> using ve = vector<T>;
template <typename T, int sz> using ar = array<T, sz>;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
#define endl '\n'
int press(string p);
string guess_sequence(int N) {
    string s= "";
    for(int i = 0; i < N; i++){
        ve<char> lst;
        for(char j : {'A', 'B', 'X', 'Y'}){
            if(i > 0 && j == s[0]){
                continue;
            }
            lst.pb(j);
        }
        for(char j : lst){
            int sc = press(s + j);
            if(sc == (i+1)){
                s += j;
                break;
            }
            if(j == lst[lst.size()-2]){
                s += lst[lst.size()-1];
                break;
            } 
        }
   }
    return s;
};
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |