#include "light.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(a) a.begin(), a.end()
#define dbg(a) cerr << __LINE__ << ": " << "[" << #a << " = " << a << "]\n"
ll n;
void prepare() {
n = 1;
}
vector<ll> get(ll n) {
vector<ll> res;
int cur = 1;
while (1) {
res.push_back(n);
// dbg(n);
// dbg(cur);
if (n == 1) break;
n = max(1LL, n - (1LL << cur));
++cur;
}
reverse(all(res));
return res;
}
std::pair<long long, std::vector<long long>> join(long long p) {
ll t = p;
n += p;
vector<ll> res = get(n);
return {t, res};
}
std::pair<long long, std::vector<long long>> leave(long long p) {
int t = p;
n -= p;
vector<ll> res = get(n);
return {t, 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... |