# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
616073 | Ahmadsm2005 | Triple Jump (JOI19_jumps) | C++17 | 977 ms | 98316 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>
#define int long long
using namespace std;
int N,Q,A[500000],L,R,ANS[500000];
int S1[2000000],S2[2000000],S3[2000000];
vector<pair<int,int>>PA[500000];
int seg[2000000];
/*void upd2(int T,int v,int LL=0,int RR=500000,int idx=0){
if(LL == RR && LL == T){seg[idx] = max(seg[idx],v);return;}
else if(LL > T || RR < T)return;
upd2(T,v,LL,(LL+RR)/2,idx*2+1),upd2(T,v,(LL+RR)/2+1,RR,idx*2+2);
}
int query2(int L,int R,int LL=0,int RR=500000,int idx=0){
if(LL >= L && RR <= R)return seg[idx];
else if(LL > R || RR < L) return 0;
return max(query2(L,R,LL,(LL+RR)/2,idx*2+1),query2(L,R,(LL+RR)/2+1,RR,idx*2+2));
}*/
void upd(int T,int v,int LL = 0,int RR = 500000,int idx = 0){
if(LL == RR && LL == T){
S1[idx] = max(v,S1[idx]);
S2[idx] = A[T];
S3[idx] = S1[idx] + A[T];
return;
}
else if(LL > T || RR < T)return;
upd(T,v,LL,(LL+RR)/2,idx*2+1),upd(T,v,(LL+RR)/2+1,RR,idx*2+2);
S3[idx] = max({S3[idx*2+1],S3[idx*2+2],S1[idx*2+1] + S2[idx*2+2]});
S1[idx] = max(S1[idx*2+1],S1[idx*2+2]);
S2[idx] = max(S2[idx*2+1],S2[idx*2+2]);
}
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... |