- 2023-11-06G. wxhtzdy ORO Tree
G.wxhtzdyOROTreeAfter(finally)qualifyingfortheIOI2023,wxhtzdywasveryhappy,sohedecidedtodowhatmostcompetitiveprogrammersdo:tryingtoguesstheproblemsthatwillbeonIOI.Duringthisprocess,heaccidentallymadeaproblem,whic
- 2023-10-09CF1878G wxhtzdy ORO Tree
CF1878GwxhtzdyOROTree设\(f(x,y)\)表示树上\(x\)到\(y\)简单路径上的点权或和中\(1\)的个数。有一个性质:选取的\(z\)节点一定满足它比它左边的点(\(l\))或者右边的点(\(r\))的贡献至少要多一位,即\(f(x,l)<f(x,z)\)或\(f(y,r)<f(y,z)\),有了这个性质,问题就简单很多
- 2023-09-28G. wxhtzdy ORO Tree
G.wxhtzdyOROTree前提知识:lca求最近公共祖先(倍增)因为或运算越多值就越大,好像跟上一个相反,所以满足单调不降要点1:利用数组来对每个点到其祖先节点的或和进行计算(倍增)要点2:分别对左右两边进行分析到lca点,这样确保无误要点3:因为满足单调不降,所以遇到大于的节点对左边才有意义