This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "light.h"
#include <bits/stdc++.h>
using namespace std;
const int LOG = 63;
int sz;
int cnt;
bool flag;
vector<long long> indices;
void prepare(){
cnt = 0;
sz = 1;
indices.push_back(1);
}
pair<long long, vector<long long>> join(long long p){
cnt++;
sz += p;
vector<long long> nindices;
for (int i = 1; i < sz; i += 5) {
nindices.push_back(i);
}
nindices.push_back(sz);
indices = nindices;
return {5 * p, indices};
}
pair<long long, vector<long long>> leave(long long p){// I just need to make sure after one leave I'm able to keep the rightmost lit
cnt++;
sz -= p;
vector<long long> nindices;
for (int i = 1; i < sz; i += 5) {
nindices.push_back(i);
}
nindices.push_back(sz);
indices = nindices;
return {5 * p, indices};
}
# | 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... |