제출 #444221

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4442212021-07-13 11:29:25hiliyDistributing Candies (IOI21_candies)C++17
8 / 100
1408 ms47684 KiB
#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);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...