#include "light.h"
#include <bits/stdc++.h>
typedef long long ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(ll i=x; i>y; i--)
using namespace std;
ll n, maxi;
void prepare(){
n = 1;
maxi = n;
}
pair<long long, std::vector<long long>> join(long long p){
n += p;
set<ll> stuff;
stuff.insert(1);
maxi = max(maxi, n);
if (n==maxi){
FOR(i,1,70){
stuff.insert(n-(1<<i)+2);
}
}
else{
ll diff = maxi-n;
FOR(i,1,70){
stuff.insert(maxi-(1<<i)+2);
stuff.insert(maxi-(1<<i)+2 + diff);
}
}
vector<ll> real;
for (auto&i : stuff) if (1<=i && i<=n) real.push_back(i);
return {p, real};
}
std::pair<long long, std::vector<long long>> leave(long long p){
n -= p;
set<ll> stuff;
stuff.insert(1);
stuff.insert(n);
ll diff = maxi-n;
FOR(i,1,70){
stuff.insert(maxi-(1<<i)+2);
stuff.insert(maxi-(1<<i)+2 + diff);
}
vector<ll> real;
for (auto&i : stuff) if (1<=i && i<=n) real.push_back(i);
return {p, real};
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Correct |
2 |
Incorrect |
0 ms |
428 KB |
Not correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Incorrect |
0 ms |
344 KB |
Not correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Incorrect |
0 ms |
344 KB |
Not correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Incorrect |
0 ms |
344 KB |
Not correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Incorrect |
0 ms |
344 KB |
Not correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Incorrect |
0 ms |
344 KB |
Not correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Correct |
2 |
Incorrect |
0 ms |
344 KB |
Not correct |
3 |
Halted |
0 ms |
0 KB |
- |