# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
492671 | lukameladze | Distributing Candies (IOI21_candies) | C++17 | 2514 ms | 62832 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>
#include "candies.h"
#define f first
#define s second
#define pb push_back
#define pii pair <long long, long long>
using namespace std;
const int N = 3e5 + 5;
long long n,q,l[N],r[N],val[N],idx,c[N],le,ri,mid,mxid,mnid,ans,cc1;
vector < pii > v[N];
long long lazy[4*N];
struct nd {
long long mx;
long long mn;
long long mxidx;
long long mnidx;
long long sum;
};
nd tree[4*N],emp;
nd merge(nd a, nd b) {
nd ans;
ans.mx = max(a.mx,b.mx);
ans.mn = min(a.mn,b.mn);
if (a.mx >= b.mx) ans.mxidx = a.mxidx;
else ans.mxidx = b.mxidx;
if (a.mn <= b.mn) ans.mnidx = a.mnidx;
else ans.mnidx = b.mnidx;
ans.sum = a.sum + b.sum;
return ans;
}
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... |