# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
444221 | hiliy | Distributing Candies (IOI21_candies) | C++17 | 1408 ms | 47684 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
struct segtree{
int sz;
vector<ll> sum, mins, maxs, sumpush;
segtree(int maxn)
{
sz = maxn*4 + 4;
sum.resize(sz);
mins = maxs = sumpush = sum;
}
void push(int v, int l, int r)
{
mins[v] += sumpush[v];
maxs[v] += sumpush[v];
sum[v] += (ll)(r - l + 1)*sumpush[v];
if(l != r)
sumpush[v*2] += sumpush[v], sumpush[v*2 + 1] += sumpush[v];
sumpush[v] = 0;
}
void add(int v, int l, int r, int l1, int r1, int val)
{
push(v, l, r);
if(l > r1 || l1 > r)
return;
if(l1 <= l && r <= r1)
{
sumpush[v] += val;
push(v, l, r);
# | 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... |