# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1164242 | ChottuF | Roadside Advertisements (NOI17_roadsideadverts) | C++20 | 176 ms | 18160 KiB |
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5+5;
int P[N] , D[N] , H[N] , B[N] , pos[N];
vector<int> g[N] ,vec;
int a[N] , b[N] , d[N] , c[N] , NW , t[N*4] , t1[N*4] , u[N*4];
int up[N][20] , n , sz[N];
void upd(int v, int tl, int tr , int pos , int val){
u[v] = -1;
if(tl == tr){
t[v] = val;
t1[v] = val;
return;
}
int tm = (tl+tr) >> 1;
if(tm >= pos) upd(v*2,tl,tm,pos,val);
else upd(v*2+1,tm+1,tr,pos,val);
t[v] = t[v*2]+t[v*2+1];
t1[v] = t[v];
}
int lca(int a , int b){
if(D[a] > D[b]) swap(a,b);
for(int i = 19; i >= 0; i--){
if(D[a] <= D[up[b][i]]){
b = up[b][i];
}
}
if(a == b) return a;
# | 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... |