#include<bits/stdc++.h>
#include "light.h"
using namespace std;
#define int long long
int n;
void prepare()
{
n=1;
}
vector<long long> calc()
{
vector<int> aux;
for(int i=0;(1LL<<i)<=n;i++)
{
aux.push_back(n - (1LL<<i) + 1);
}
if(aux.back() != 1)
aux.push_back(1);
reverse(aux.begin(),aux.end());
return aux;
}
pair<long long, vector<long long>> join(long long p)
{
n += p;
return {p, calc()};
}
pair<long long, vector<long long>> leave(long long p)
{
n -= p;
return {p, calc()};
}
# | 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... |