摘要: Andrew and Chemistry Description During the chemistry lesson Andrew learned that the saturated hydrocarbons (alkanes) enter into radical chlorination 阅读全文
posted @ 2019-07-17 21:40 Parsnip 阅读(186) 评论(0) 推荐(0) 编辑
摘要: LCA Description 给出一个n个节点的有根树(编号为0到n 1,根节点为0)。一个点的深度定义为这个节点到根 的距离+1。 设dep[i]表示点i的深度,LCA(i,j)表示i与j的最近公共祖先。 有q次询问,每次询问给出l r z,求sigma_{l using namespace s 阅读全文
posted @ 2019-07-17 21:24 Parsnip 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 树上匹配 Description 懒惰的温温今天上班也在偷懒。盯着窗外发呆的温温发现,透过窗户正巧能看到一棵 n 个节点的树。一棵 n 个节点的树包含 n 1 条边,且 n 个节点是联通的。树上两点之间的距 离即两点之间的最短路径包含的边数。 突发奇想的温温想要选择一个树上的边集(可以为空)删除, 阅读全文
posted @ 2019-07-17 21:11 Parsnip 阅读(564) 评论(0) 推荐(0) 编辑