# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
853161 | abcvuitunggio | Distributing Candies (IOI21_candies) | C++17 | 908 ms | 33648 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 "candies.h"
#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef pair <int, int> pll;
int n,q;
vector <int32_t> ve[200001],res;
int lazy[900001],pos;
pll st[900001];
pll combine(pll a, pll b){
return {min(a.first,b.first),max(a.second,b.second)};
}
void down(int node, int l, int r){
if (!lazy[node]||l==r)
return;
st[node<<1].first+=lazy[node];
st[node<<1].second+=lazy[node];
lazy[node<<1]+=lazy[node];
st[node<<1|1].first+=lazy[node];
st[node<<1|1].second+=lazy[node];
lazy[node<<1|1]+=lazy[node];
lazy[node]=0;
}
void update(int node, int l, int r, int u, int v, int val){
if (l>v||r<u||l>r||u>v)
return;
if (l>=u&&r<=v){
st[node].first+=val;
st[node].second+=val;
lazy[node]+=val;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |