![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分
我要满满的AC
不积跬步,无以至千里
展开
-
HDU 5439 Aggregated Counting 找规律+二分
题意: The sequence is generated by the following scheme. 1. First, write down 1, 2 on a paper. 2. The 2nd number is 2, write down 2 2’s (including the one originally on the paper). The paper thus has原创 2015-09-13 18:59:40 · 948 阅读 · 0 评论 -
hihoCoder1232 Couple Trees LCA倍增算法+二分
题意:给你两颗树,节点编号都是1-n。根节点都为1,且父节点编号必大于子节点。有m次询问,每次给出两个坐标x,y,通过换算(与上一次询问结果有关),得到了两个节X,Y, 问这两个节点的在这两颗树中的最近公共祖先。 方法:求出每个点的倍增父节点,然后每次X,Y朝着倍增父节点尽量移动(尽量保证移的位置的节点大于另一个节点),如果不能保证,至少也得往前移一位。#include #inclu原创 2015-10-09 23:37:30 · 764 阅读 · 0 评论