并查集
RookieZQF
尽自己最大努力才能不后悔
展开
-
DoIt is Being Flooded
Description Global warming affects the whole world right now. DoIt is a country which is surrounded by the sea and suffering from global warming. Scientists in DoIt find out that the sea level will翻译 2015-11-16 19:46:41 · 331 阅读 · 1 评论 -
修路方案
描述 南将军率领着许多部队,它们分别驻扎在N个不同的城市里,这些城市分别编号1~N,由于交通不太便利,南将军准备修路。 现在已经知道哪些城市之间可以修路,如果修路,花费是多少。 现在,军师小工已经找到了一种修路的方案,能够使各个城市都联通起来,而且花费最少。 但是,南将军说,这个修路方案所拼成的图案很不吉利,想让小工计算一下是否存在另外一种方案花费和刚才的方案一样,现在你来帮小工写一个程翻译 2015-11-28 18:35:24 · 903 阅读 · 0 评论 -
BC 68 Tree
问题描述 有一个树(n个点, n−1条边的联通图),点标号从1~n,树 的边权是0或1.求离每个点最近的点个数(包括自己). 输入描述 第一行一个数字T,表示T组数据. 对于每组数据,第一行是一个n,表示点个数,接下来n −1,每行三个整数u,v,w,表示一条边连接的两个点和边 权. T=50,1≤n≤100000,1≤u,v≤n,0≤w≤1 输出描述翻译 2016-01-19 18:40:10 · 237 阅读 · 0 评论 -
POJ1703 Find them, Catch them
Description The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to iden翻译 2016-01-21 18:57:28 · 227 阅读 · 0 评论 -
数轴染色
题目描述 Description 在一条数轴上有N个点,分别是1~N。一开始所有的点都被染成黑色。接着 我们进行M次操作,第i次操作将[Li,Ri]这些点染成白色。请输出每个操作执行后 剩余黑色点的个数。 输入描述 Input Description 输入一行为N和M。下面M行每行两个数Li、Ri 输出描述 Output Description翻译 2016-02-20 08:55:59 · 796 阅读 · 0 评论