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>
#define ll long long
using namespace std;
ll n;
void prepare(){
    n = 1;
}
pair<long long, vector<long long>> join(long long p){
    n+=p;
    vector<ll> sol;
    ll temp = 2;
    while(n-temp+2>0){
        sol.push_back(n-temp+2);
        temp<<=1;
    }
    if(sol[sol.size()-1]!=1){
        sol.push_back(1);
    }
    reverse(sol.begin(), sol.end());
    return {p, sol};
}
pair<long long, vector<long long>> leave(long long p){
    n-=p;
    vector<ll> sol;
    ll temp = 2;
    while(n-temp+2>0){
        sol.push_back(n-temp+2);
        temp<<=1;
    }
    if(sol[sol.size()-1]!=1){
        sol.push_back(1);
    }
    reverse(sol.begin(), sol.end());
    return {p, sol};
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |