# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
389661 | denkendoemeer | Two Antennas (JOI19_antennas) | C++14 | 162 ms | 33220 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 ll long long
const int inf=1e9;
using namespace std;
int h[200005],a[200005],b[200005],ans[200005],ql[200005],qr[200005],lazy[550000],n;
vector<int>t[200005],t1[200005],t2[200005];
array<int,2>aint[550000];
void upd(int nod,int x)
{
aint[nod][1]=max(aint[nod][0]+x,aint[nod][1]);
lazy[nod]=max(lazy[nod],x);
}
void push(int nod)
{
upd(2*nod,lazy[nod]);
upd(2*nod+1,lazy[nod]);
lazy[nod]=-inf;
}
void update1(int nod,int st,int dr,int poz,int val)
{
if (st==dr){
aint[nod][0]=val;
return ;
}
push(nod);
int mij=(st+dr)/2;
if (poz<=mij)
update1(nod*2,st,mij,poz,val);
else
update1(nod*2+1,mij+1,dr,poz,val);
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... |