#include "light.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pi;
typedef vector<pi> pii;
typedef tuple<int,int,int> ti;
typedef vector<ll> li;
typedef vector<li> lii;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define F first
#define S second
#define PB push_back
#define LSOne(s) ((s)&(-s))
#define all(x) (x).begin(),(x).end()
ll INF=1000000000000000010;
int inf=1e9+10;
ll M=1e9+7;
ll n=1;
vector<ll> a(1,1);
void prepare(){}
std::pair<long long, std::vector<long long>> join(long long p){
vector<ll> b;
while(a.size()>1&&a.back()>n-p)a.pop_back();
ll k=1,pos=n+p+1;
while(a.back()<pos-k){
pos-=k;
b.PB(pos);
k*=2;
}
reverse(all(b));
for(auto u:b)a.PB(u);
n+=p;
return {p,a};
}
std::pair<long long, std::vector<long long>> leave(long long p){
vector<ll> b;
while(a.size()>1&&a.back()>=n-2*p)a.pop_back();
ll k=1,pos=n-p+1;
while(a.back()<pos-k){
pos-=k;
b.PB(pos);
k*=2;
}
reverse(all(b));
for(auto u:b)a.PB(u);
n-=p;
return {p,a};
}
# | 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... |