# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
344285 | TadijaSebez | 3단 점프 (JOI19_jumps) | C++11 | 1520 ms | 67308 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 pb push_back
const int N=500050;
const int M=2*N;
const int inf=1e9+7;
int a[N],ls[M],rs[M],tsz,root,mx1[M],mx2[M],lzy[M];
void Build(int &c, int ss, int se)
{
c=++tsz;mx2[c]=-inf;lzy[c]=-inf;
if(ss==se){ mx1[c]=a[ss];return;}
int mid=ss+se>>1;
Build(ls[c],ss,mid);
Build(rs[c],mid+1,se);
mx1[c]=max(mx1[ls[c]],mx1[rs[c]]);
}
void Upd(int c, int x)
{
mx2[c]=max(mx2[c],mx1[c]+x);
lzy[c]=max(lzy[c],x);
}
void Push(int c)
{
if(lzy[c]!=-inf)
{
Upd(ls[c],lzy[c]);
Upd(rs[c],lzy[c]);
lzy[c]=-inf;
}
}
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... |