摘要: 题目描述 小强要在NN个孤立的星球上建立起一套通信系统。这套通信系统就是连接NN个点的一个树。 这个树的边是一条一条添加上去的。在某个时刻,一条边的负载就是它所在的当前能够 联通的树上路过它的简单路径的数量。 例如,在上图中,现在一共有了55条边。其中,(3,8)(3,8)这条边的负载是66,因 为 阅读全文
posted @ 2019-07-03 21:51 BEYang_Z 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给定n个点以及每个点的权值,要你处理接下来的m个操作。操作有4种。操作从0到3编号。点从1到n编号。 0:后接两个整数(x,y),代表询问从x到y的路径上的点的权值的xor和。保证x到y是联通的。 1:后接两个整数(x,y),代表连接x到y,若x到y已经联通则无需连接。 2:后接两个整数( 阅读全文
posted @ 2019-07-03 21:23 BEYang_Z 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Description Description Input Output Input Input Output Output Sample Input 6 1 24 3 2 8 6 2 Sample Output 3 5 Sample Input 6 1 24 3 2 8 6 2 Sample In 阅读全文
posted @ 2019-07-03 16:48 BEYang_Z 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Description Description Input Output Input Input Output Output Sample Input 5 and 13 5 2 7 1 Sample Output 1 12 15 11 3 Sample Input 5 and 13 5 2 7 1 阅读全文
posted @ 2019-07-03 16:33 BEYang_Z 阅读(267) 评论(0) 推荐(0) 编辑
摘要: Description Description Input Output Input Input Output Output Sample Input 5 41 21 33 43 51 42 41 22 5 Sample Output 3112 Sample Input 5 41 21 33 43 阅读全文
posted @ 2019-07-03 16:27 BEYang_Z 阅读(212) 评论(0) 推荐(0) 编辑
摘要: Description Description Input Output Input Input Output Output Sample Input 51 4 5 2 33 4 2 1 5 Sample Output 3 Sample Input 51 4 5 2 33 4 2 1 5 Sampl 阅读全文
posted @ 2019-07-03 16:21 BEYang_Z 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Description Description Input Output Input Input Output Output Sample Input 4 34 3 35 1 62 6 13 2 9 Sample Output 4.4286 Sample Input 4 34 3 35 1 62 6 阅读全文
posted @ 2019-07-03 16:12 BEYang_Z 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Description Description Input Output Input Input Output Output Sample Input 4 60 1 22 1 32 21 32 22 32 11 3 Sample Output 0304 Sample Input 4 60 1 22 阅读全文
posted @ 2019-07-03 15:58 BEYang_Z 阅读(294) 评论(0) 推荐(0) 编辑
摘要: Description 给定一个n 个点的无向图,保证联通且无环无重边,每个点上有一个可修改的权值,每次断掉一条边、修改某个节点上的权值或询问两个点之间的连通性。 Description 给定一个n 个点的无向图,保证联通且无环无重边,每个点上有一个可修改的权值,每次断掉一条边、修改某个节点上的权值 阅读全文
posted @ 2019-07-03 11:30 BEYang_Z 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Description 给定一棵有根树(根节点为1),每个点都带有权值,对于点u,其权值设为a[u],其父亲为fa[i]。现有两个函数f1,f2,定义如下:如果u=1,f1[u]=a[u],f2[u]=1否则如果f1[fa[u]]+1<a[u] f1[u]=a[u],f2[u]=1;如果f1[fa[ 阅读全文
posted @ 2019-07-03 11:01 BEYang_Z 阅读(240) 评论(0) 推荐(0) 编辑