# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
615827 | AbdelmagedNour | Triple Jump (JOI19_jumps) | C++17 | 812 ms | 46560 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;
const int N=500005;
struct node{
int res,f,mx;
node(){res=f=mx=0;}
node(int _res,int _f,int _mx){
res=_res;
f=_f;
mx=_mx;
}
};
struct SegTree{
node tree[1<<20];
int sz;
node Merge(node&a,node&b){
int res=max({a.res,b.res,a.f+b.mx}),f=max(a.f,b.f),mx=max(a.mx,b.mx);
return node(res,f,mx);
}
void build(int l,int r,int p,vector<int>&a){
if(l==r){
tree[p].f=-1e9;
tree[p].res=-1e9;
tree[p].mx=0;
if(l<a.size())tree[p].mx=a[l];
return;
}
int md=(l+r)>>1;
build(l,md,p*2+1,a);
build(md+1,r,p*2+2,a);
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... |