# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
105714 | Pro_ktmr | Employment (JOI16_employment) | C++14 | 1018 ms | 22580 KiB |
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<bits/stdc++.h>
using namespace std;
#define LL long long
#define MP(a,b) make_pair(a,b)
struct SegmentTree{
private:
int N;
vector<int> node,lazy;
public:
void init(int n){
N = 1;
while(N < n) N *= 2;
N = 2*N-1;
node.clear();
lazy.clear();
for(int i=0; i<N; i++) node.push_back(0);
for(int i=0; i<N; i++) lazy.push_back(0);
}
void eval(int k, int l, int r){
if(lazy[k] == 0) return;
node[k] += (r-l)*lazy[k];
if(r-l != 1){
lazy[2*k+1] += lazy[k];
lazy[2*k+2] += lazy[k];
}
lazy[k] = 0;
}
void update(int a, int b, int x, int k=0, int l=0, int r=-1){
if(r == -1) r = (N+1) / 2;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |