The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.
Given any two nodes in a bin ......
A template of discretization + scaning line + segment tree.
It's easy to understand, but a little difficult for coding as it has a few details.
inclu ......
// luogu-judger-enable-o2
include <cstdio>
//include <iostream>
include <cstring>
include <algorithm>
include <cmath>
define R(a,b,c) for(regist ......
The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.
Given any two nodes in a bin ......