#include <bits/stdc++.h>
#include "light.h"
using namespace std;
void prepare() {}
long long tot = 1;
pair<long long, vector<long long>> join(long long x)
{
pair<long long, vector<long long>> ans;
ans.first = x;
tot += x;
long long pos = tot;
for (int j = 0; j < 100; j++)
{
ans.second.push_back(pos);
pos -= (1 << j);
if (pos < 2)
break;
}
ans.second.push_back(1);
sort(ans.second.begin(), ans.second.end());
return ans;
}
pair<long long, vector<long long>> leave(long long x)
{
pair<long long, vector<long long>> ans;
ans.first = x;
tot -= x;
long long pos = tot;
for (int j = 0; j < 100; j++)
{
ans.second.push_back(pos);
pos -= (1 << j);
if (pos < 2)
break;
}
ans.second.push_back(1);
sort(ans.second.begin(), ans.second.end());
return ans;
}
/*int main()
{
long long N;
cin >> N;
for (long long i = 0; i < N; i++)
{
long long x;
cin >> x;
pair<long long, vector<long long>> y;
if (x > 0)
y = join(x);
else
y = leave(-x);
cout << y.first << '\n';
for (long long j = 0; j < y.second.size(); j++)
cout << y.second[j] << ' ';
cout << endl;
}
}*/
# | 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... |