随笔分类 - 树上乱搞---倍增
摘要:Description 给您一颗树,每个节点有个初始值。 现在支持以下两种操作: 1. C i x(0<=x<2^31) 表示将i节点的值改为x。 2. Q i j x(0<=x<2^31) 表示询问i节点到j节点的路径上有多少个值为x的节点。 给您一颗树,每个节点有个初始值。 现在支持以下两种操作
阅读全文
摘要:There are N cities in a country, and there is one and only one simple path between each pair of cities. A merchant has chosen some paths and wants to
阅读全文