#include "light.h"
#include <bits/stdc++.h>
using namespace std;
long long cnt=1, vs=0;
void prepare(){
}
std::pair<long long, std::vector<long long>> join(long long p){
cnt+=p;
vector<long long> res;
if (vs)
{
res.push_back(cnt);
return make_pair(p, res);
}
long long pw=2;
while (cnt-pw+2>1)
{
res.push_back(cnt-pw+2);
pw*=2;
}
res.push_back(1);
reverse(res.begin(), res.end());
return make_pair(p, res);
}
std::pair<long long, std::vector<long long>> leave(long long p){
vs=1;
cnt-=p;
vector<long long> res;
res.push_back(cnt);
return make_pair(p, res);
}
# | 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... |