# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1174096 | Warinchai | Two Antennas (JOI19_antennas) | C++20 | 323 ms | 71404 KiB |
#include<bits/stdc++.h>
#define int long long
using namespace std;
vector<pair<int,int>>add[400005];
vector<pair<int,int>>del[400005];
int inf=1e18+5;
struct segtreemx{
struct node{
int h,ans;
node(int _ans=-inf,int _h=-inf){
ans=_ans,h=_h;
}
friend node operator+(node a,node b){
return node(max(a.ans,b.ans),max(a.h,b.h));
}
};
node info[800005];
int lz[800005];
void push(int st,int en,int i){
if(lz[i]==inf)return;
//cerr<<st<<" "<<en<<" "<<i<<"\n";
info[i].ans=max(info[i].ans,info[i].h-lz[i]);
if(st!=en)lz[i*2]=min(lz[i*2],lz[i]),lz[i*2+1]=min(lz[i*2+1],lz[i]);
lz[i]=inf;
}
void upd(int st,int en,int i,int pos,int val){
push(st,en,i);
if(st>pos||en<pos)return;
if(st==en)return info[i]=node(-inf,val),void();
int m=(st+en)/2;
# | 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... |