摘要: DescriptionByteotian Interstellar Union (BIU) has recently discovered a new planet in a nearby galaxy. The planet is unsuitable for colonisation due t 阅读全文
posted @ 2019-07-19 12:33 BEYang_Z 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给出一个n个节点的有根树(编号为0到n-1,根节点为0)。一个点的深度定义为这个节点到根的距离+1。 设dep[i]表示点i的深度,LCA(i,j)表示i与j的最近公共祖先。 有q次询问,每次询问给出l r z,求\sum_{l \leq i \leq r}dep[LCA(i,z)]∑l≤ 阅读全文
posted @ 2019-07-19 11:28 BEYang_Z 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Description Input 修正一下 l = (l_0 + x – 1) mod n + 1, r = (r_0 + x – 1) mod n + 1 修正一下 l = (l_0 + x – 1) mod n + 1, r = (r_0 + x – 1) mod n + 1 Output H 阅读全文
posted @ 2019-07-19 09:31 BEYang_Z 阅读(150) 评论(0) 推荐(0) 编辑