【并查集算法】
文章平均质量分 78
zthgreat
这个人很懒,什么都没有留下
展开
-
hdu 1272小希的迷宫
小希的迷宫 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 26716 Accepted Submission(s): 8240 Problem Description 上次Gardon的迷宫城堡小希玩了很久原创 2014-08-21 23:38:12 · 547 阅读 · 0 评论 -
poj 2236 Wireless Network
Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all com原创 2014-10-23 18:56:49 · 562 阅读 · 0 评论 -
poj 1611 The Suspects
The Suspects Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 22763 Accepted: 11060 Description Severe acute respiratory syndrome (SARS), an atypical pneu原创 2014-08-24 16:55:41 · 381 阅读 · 0 评论 -
zoj 3659 Conquer a New Region
The wheel of the history rolling forward, our king conquered a new region in a distant continent. There are N towns (numbered from 1 to N) in this region connected by several roads. It's confirmed th原创 2014-09-26 21:12:29 · 529 阅读 · 0 评论 -
hdu 2818 Building Block
Problem Description John are playing with blocks. There are N blocks (1 M X Y : Put the whole pile containing block X up to the pile containing Y. If X and Y are in the same pile, just ignore t原创 2014-09-24 00:05:41 · 485 阅读 · 0 评论 -
wikioi 1001 舒适的路线
题目描述 Description Z小镇是一个景色宜人的地方,吸引来自各地的观光客来此旅游观光。 Z小镇附近共有 N(1 输入描述 Input Description 第一行包含两个正整数,N和M。 接下来的M行每行包含三个正整数:x,y和v(1≤x,y≤N,0 最后一行包含两个正整数s,t,表示想知道从景点s到景点t最大最小速度比最小的路径。s和t不可能相同。原创 2014-10-04 17:01:41 · 1288 阅读 · 0 评论 -
Wikioi 1069 关押罪犯
题目描述 Description S 城现有两座监狱,一共关押着N 名罪犯,编号分别为1~N。他们之间的关系自然也极 不和谐。很多罪犯之间甚至积怨已久,如果客观条件具备则随时可能爆发冲突。我们用“怨 气值”(一个正整数值)来表示某两名罪犯之间的仇恨程度,怨气值越大,则这两名罪犯之 间的积怨越多。如果两名怨气值为c 的罪犯被关押在同一监狱,他们俩之间会发生摩擦,并 造成影响力为c 的冲原创 2014-10-04 19:28:18 · 894 阅读 · 2 评论 -
hdu 2545 树上战争
树上战争 Time Limit: 10000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 538 Accepted Submission(s): 287 Problem Description 给一棵树,如果树上的某个节点被某个人占据,则原创 2014-08-24 15:58:41 · 502 阅读 · 0 评论 -
wikioi 1231 最优布线问题
题目描述 Description 学校需要将n台计算机连接起来,不同的2台计算机之间的连接费用可能是不同的。为了节省费用,我们考虑采用间接数据传输结束,就是一台计算机可以间接地通过其他计算机实现和另外一台计算机连接。 为了使得任意两台计算机之间都是连通的(不管是直接还是间接的),需要在若干台计算机之间用网线直接连接,现在想使得总的连接费用最省,让你编程计算这个最小的费用。原创 2014-10-04 20:16:15 · 1312 阅读 · 0 评论 -
并查集(Union-Find)算法介绍
并查集原创 2014-10-11 21:18:21 · 1058 阅读 · 0 评论 -
wikioi 2597 团伙
题目描述 Description 1920年的芝加哥,出现了一群强盗。如果两个强盗遇上了,那么他们要么是朋友,要么是敌人。而且有一点是肯定的,就是: 我朋友的朋友是我的朋友; 我敌人的敌人也是我的朋友。 两个强盗是同一团伙的条件是当且仅当他们是朋友。现在给你一些关于强盗们的信息,问你最多有多少个强盗团伙。 输入描述 Input Description 输入文件原创 2014-10-05 20:59:09 · 998 阅读 · 0 评论 -
hdu 3938 Portal
Problem Description ZLGG found a magic theory that the bigger banana the bigger banana peel .This important theory can help him make a portal in our universal. Unfortunately, making a pair of porta原创 2014-09-25 22:18:08 · 612 阅读 · 0 评论 -
hdu 4313 Matrix
Problem Description Machines have once again attacked the kingdom of Xions. The kingdom of Xions has N cities and N-1 bidirectional roads. The road network is such that there is a unique path betw原创 2014-09-24 12:29:53 · 522 阅读 · 0 评论 -
hdu 1213 How Many Tables
How Many Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 13772 Accepted Submission(s): 6750 Problem Description Today is原创 2014-08-23 23:25:22 · 423 阅读 · 0 评论 -
poj 2545 Ubiquitous Religions
Ubiquitous Religions Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 24588 Accepted: 12121 Description There are so many different religions in the world原创 2014-08-24 17:29:36 · 490 阅读 · 0 评论 -
hdu 4496 D-City
D-City Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 1540 Accepted Submission(s): 575 Problem Description Luxer is a really ba原创 2014-08-25 21:07:30 · 476 阅读 · 0 评论 -
hdu 1598 find the most comfortable road
Problem Description XX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度的差越小乘坐越舒服 ,(理解为SARS的限速要求,flycar必须瞬原创 2014-09-22 00:19:12 · 555 阅读 · 0 评论 -
zoj 2833 Friendship
Time Limit: 3 Seconds Memory Limit: 32768 KB A friend is like a flower, a rose to be exact, Or maybe like a brand new gate that never comes unlatched. A friend is like an owl, b原创 2014-09-21 11:54:31 · 808 阅读 · 0 评论 -
hdu 2120 Ice_cream's world I
Ice_cream's world I Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 569 Accepted Submission(s): 322 Problem Description ice_crea原创 2014-08-25 22:10:10 · 533 阅读 · 0 评论 -
hdu 1856 More is better
More is better Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 327680/102400 K (Java/Others) Total Submission(s): 14784 Accepted Submission(s): 5442 Problem Description Mr Wang原创 2014-08-23 21:12:01 · 448 阅读 · 0 评论 -
hdu 1232畅通工程
畅通工程 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 30809 Accepted Submission(s): 16200 Problem Description 某省调查城镇交通状况,得到现有城镇道路原创 2014-08-17 19:04:19 · 501 阅读 · 0 评论 -
BNU 16485 Build The Electric System
Build The Electric System Time Limit: 2000ms Memory Limit: 65536KB This problem will be judged on ZJU. Original ID: 2966 64-bit integer IO format: %lld Java class name: Main Prev原创 2014-08-30 20:44:04 · 1198 阅读 · 0 评论 -
hdu 1863 畅通工程
畅通工程 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 17678 Accepted Submission(s): 7458 Problem Description 省政府“畅通工程”的目标是使全省任何两个原创 2014-08-31 21:00:25 · 472 阅读 · 0 评论 -
hdu 3371 Connect the Cities(最小生成树))
Connect the Cities Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10336 Accepted Submission(s): 2941 Problem Description In 210原创 2014-09-01 00:13:12 · 471 阅读 · 0 评论