# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
750410 | jamezzz | Sequence (APIO23_sequence) | C++17 | 1591 ms | 68020 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 "sequence.h"
#include <bits/stdc++.h>
using namespace std;
#define pf printf
#define pb push_back
#define maxn 500005
struct node{
int N,mn[maxn<<2],mx[maxn<<2],lz[maxn<<2];
void ppo(int i,int s,int e){
mx[i]+=lz[i];
mn[i]+=lz[i];
if(s!=e){
lz[2*i+1]+=lz[i];
lz[2*i+2]+=lz[i];
}
lz[i]=0;
}
void up(int i,int s,int e,int x,int y,int nv){
if(s==x&&e==y){lz[i]+=nv;return;}
int m=(s+e)>>1;
if(y<=m)up(2*i+1,s,m,x,y,nv);
else if(x>m)up(2*i+2,m+1,e,x,y,nv);
else up(2*i+1,s,m,x,m,nv),up(2*i+2,m+1,e,m+1,y,nv);
ppo(2*i+1,s,m);
ppo(2*i+2,m+1,e);
mn[i]=min(mn[2*i+1],mn[2*i+2]);
mx[i]=max(mx[2*i+1],mx[2*i+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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |