随笔分类 -  专题:点分治

摘要:题目描述: You are given a tree (an acyclic undirected connected graph) with N nodes, and nodes numbered 1,2,3...,N. Each edge has an integer value assigne 阅读全文
posted @ 2019-03-05 19:54 Hëinz 阅读(253) 评论(0) 推荐(0)
摘要:题目描述: You are given a tree (an acyclic undirected connected graph) with N nodes. The tree nodes are numbered from 1 to N. We define dist(a, b) as the 阅读全文
posted @ 2019-03-03 10:30 Hëinz 阅读(347) 评论(0) 推荐(0)
摘要:树上的分治分两种: 点分治 和 边分治 ,点分治由于其比较稳定的复杂度,是两者中更为常用的一种。 点分治 顾名思义,就是将树用重心分割为几块,然后在每棵树中进行类似“暴力”的操作,已达到复杂度优化的作用 重心,即一棵树上的一个点,以其作为根,其最大子树大小最小的点 复杂度 考虑最坏情况,一个重心只有 阅读全文
posted @ 2019-03-01 21:45 Hëinz 阅读(153) 评论(0) 推荐(0)
摘要:题目描述: Give a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min distance between node u and v. Giv 阅读全文
posted @ 2019-03-01 21:38 Hëinz 阅读(212) 评论(0) 推荐(0)
摘要:题目描述: Lady CA has a tree with n points numbered 1,2,...,n , and each edge has its weight. The unique route connecting two points is called a chain, an 阅读全文
posted @ 2019-03-01 21:31 Hëinz 阅读(200) 评论(0) 推荐(0)