# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1173553 | Warinchai | Two Antennas (JOI19_antennas) | C++20 | 15 ms | 24132 KiB |
#include<bits/stdc++.h>
#define int long long
using namespace std;
vector<pair<int,int>>add[200005];
vector<pair<int,int>>del[200005];
int inf=1e18+5;
struct node{
int mx,mn;
node(int _mx=-inf,int _mn=inf){
mx=_mx,mn=_mn;
}
friend node operator+(node a,node b){
return node(max(a.mx,b.mx),min(a.mn,b.mn));
}
};
struct segtree{
node info[800005];
void upd(int st,int en,int i,int pos,node val){
if(st>pos||en<pos)return;
if(st==en)return info[i]=val,void();
int m=(st+en)/2;
upd(st,m,i*2,pos,val);
upd(m+1,en,i*2+1,pos,val);
info[i]=info[i*2]+info[i*2+1];
}
node fans(int st,int en,int i,int l,int r){
if(st>r||en<l)return node();
if(st>=l&&en<=r)return info[i];
int m=(st+en)/2;
return fans(st,m,i*2,l,r)+fans(m+1,en,i*2+1,l,r);
# | 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... |