摘要:
思路:裸的LCA#include#include#include#include#include#include#include#include#include#include#include#define pb push_back#define mp make_pair#define Maxn 40010#define Maxm 80002#define LL __int64#define Abs(x) ((x)>0?(x):(-x))#define lson(x) (x > que[Maxn];void init(){ memset(head,-1,sizeof(head)); 阅读全文
摘要:
思路: 每个点有三种状态,本身有塔,被子节点的塔覆盖,被父节点的塔覆盖。#include#include#include#include#include#include#include#include#include#include#include#define Maxn 10100#define Maxm 100010#define LL __int64#define Abs(x) ((x)>0?(x):(-x))#define lson(x) (x<<1)#define rson(x) (x<<1|1)#define inf 1000000#define Mo 阅读全文