![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
并查集/欧拉路/最小生成树
Prim233
南阳理工
展开
-
BNUOJ-20950-沉重的货物(最小生成树的Prim算法)
E. 沉重的货物 Time Limit: 1000msMemory Limit: 65536KB 64-bit integer IO format: %lld Java class name: Main Submit Status PID: 20950CUITCPC是一个专门生产大型货运火车的工厂。他们的新型货运火车XX V1.0,是如此之大,以至于可以运输的货物的重量并不取决于那个火原创 2016-05-11 12:44:26 · 488 阅读 · 0 评论 -
ZOJ-1586-QS Network(最小生成树 普利姆)
E - QS Network Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu SubmitStatusPracticeZOJ 1586 Description Sunny Cup 2003 - Preliminary RoundApril 20th, 12:00 - 17:00Problem原创 2016-05-22 14:52:43 · 427 阅读 · 1 评论 -
POJ-1258-Agri-Net(最小生成树 普利姆)
I - Agri-Net Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 1258 Description Farmer John has been elected mayor of his town! One of his campaig原创 2016-05-22 15:10:52 · 359 阅读 · 0 评论 -
2016HDU多校联赛-HDU-5723-Abandoned country(最小生成树 邻接表DFS)
Abandoned countryTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 825 Accepted Submission(s): 221Problem Description An abandoned country ha原创 2016-07-20 10:05:21 · 485 阅读 · 0 评论 -
NYOJ-42-一笔画问题(欧拉路 判图联通)
一笔画问题 时间限制:3000 ms | 内存限制:65535 KB 难度:4 描述 zyc从小就比较喜欢玩一些小游戏,其中就包括画一笔画,他想请你帮他写一个程序,判断一个图是否能够用一笔画下来。 规定,所有的边都只能画一次,不能重复画。 输入 第一行只有一个正整数N(N<=10)表示测试数据的组数。 每组测试数据的第一行有两个正整数P,Q(P<=1000,Q<=2000),分别原创 2016-08-04 14:52:07 · 547 阅读 · 0 评论 -
POJ-1861-Network(克鲁斯卡尔)
Network Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 16071 Accepted: 6369 Special Judge DescriptionAndrew is working as system administrator and is planning to establi原创 2016-08-08 10:46:07 · 287 阅读 · 0 评论 -
POJ-1251-Jungle Roads(克鲁斯卡尔)
Jungle Roads Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 24050 Accepted: 11282 DescriptionThe Head Elder of the tropical island of Lagrishan has a problem. A burst of fore原创 2016-08-08 11:07:29 · 241 阅读 · 0 评论 -
POJ-1287-Networking(克鲁斯卡尔)
Networking Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8729 Accepted: 4832 DescriptionYou are assigned to design network connections between certain points in a wide area. Yo原创 2016-08-08 11:30:20 · 269 阅读 · 0 评论 -
UVA-1395(最小瓶颈生成树)
题目地址戳我题意:多组数据,每组数据第一行给出N,M代表点和边的数量。接着M行每行u,v,w代表u和v之间的权值为w(有向无向貌似不影响),对于图中的每个生成树,求出生成树中最大权值与最小权值的差,求出所有生成树中最大权值与最小权值差的最小值。思路:对权值排序后枚举L~R的区间即可。代码#include<stdio.h>#include<string.h>#include<queue>#inc原创 2016-09-27 17:09:08 · 635 阅读 · 0 评论 -
HDU-2236-Wireless Network(并查集)
Wireless Network Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 24404 Accepted: 10167 DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical原创 2016-10-27 21:24:45 · 350 阅读 · 0 评论 -
HDU-1213-How Many Tables(并查集)
How Many TablesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 25444 Accepted Submission(s): 12696Problem Description Today is Ignatius’ bi原创 2016-10-28 12:48:54 · 209 阅读 · 0 评论 -
POJ-1611-The Suspects(并查集)
The Suspects Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 34633 Accepted: 16805 DescriptionSevere acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiol原创 2016-10-28 16:02:27 · 236 阅读 · 0 评论 -
CodeForces 722C. Destroying Array(并查集 好题)
C. Destroying Array time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output You are given an array consisting of n non-negative integers a1, a2, …,原创 2016-11-29 20:07:08 · 452 阅读 · 0 评论 -
POJ-2421-Constructing Roads(最小生成树 普利姆)
D - Constructing Roads Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 2421 Description There are N villages, which are numbered from 1 to N, an原创 2016-05-21 19:43:15 · 1240 阅读 · 2 评论 -
POJ-2031-Building a Space Station-(最小生成树 普利姆)
C - Building a Space Station Time Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 2031 Description You are a member of the space station engineering原创 2016-05-21 17:30:40 · 293 阅读 · 0 评论 -
POJ-1251-Jungle Roads(最小生成树 克鲁斯卡尔)
A - Jungle Roads Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 1251 Description The Head Elder of the tropical island of Lagrishan has a probl原创 2016-05-21 15:20:53 · 714 阅读 · 0 评论 -
POJ-2236-Wireless Network(并查集)
A - Wireless Network Time Limit:10000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 2236 Description An earthquake takes place in Southeast Asia. The ACM (Asi原创 2016-05-26 11:19:00 · 304 阅读 · 0 评论 -
POJ-1308-Is It A Tree?(并查集)
E - Is It A Tree? Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 1308 Description A tree is a well-known data structure that is either empty (n原创 2016-05-27 13:45:02 · 575 阅读 · 1 评论 -
POJ-1751-Highways(普利姆 打印最小生成树的边)
H - Highways Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 1751 Description The island nation of Flatopia is perfectly flat. Unfortunately, Fl原创 2016-05-30 13:40:31 · 1995 阅读 · 0 评论 -
NYOJ-38-布线问题(普利姆)
布线问题 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 南阳理工学院要进行用电线路改造,现在校长要求设计师设计出一种布线方式,该布线方式需要满足以下条件: 1、把所有的楼都供上电。 2、所用电线花费最少 输入 第一行是一个整数n表示有n组测试数据。(n<5) 每组测试数据的第一行是两个整数v,e. v表示学校里楼的总个数(v<=500) 随后的e原创 2016-05-30 15:29:36 · 502 阅读 · 0 评论 -
HDU-1233-畅通工程(并查集)
B - 畅通工程 Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1232 Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通原创 2016-05-18 20:05:56 · 520 阅读 · 2 评论 -
HDU-1213-How Many Tables(并查集)
A - How Many Tables Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1213 Description Today is Ignatius’ birthday. He invites a lot of friends. N原创 2016-05-18 20:36:54 · 345 阅读 · 0 评论 -
HDU-1856-More is better(并查集 集合最值)
C - More is better Time Limit:1000MS Memory Limit:102400KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1856 Description Mr Wang wants some boys to help him with a project. Because原创 2016-05-18 23:04:41 · 371 阅读 · 0 评论 -
POJ-2524-Ubiquitous Religions(并查集 集合数量)
E - Ubiquitous Religions Time Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 2524 Description 当今世界有很多不同的宗教,很难通晓他们。你有兴趣找出在你的大学里有多少种不同的宗教信仰。 你知道在你的大学原创 2016-05-19 11:39:06 · 298 阅读 · 0 评论 -
POJ-1308-Is It A Tree?(并查集 判断树)
F - Is It A Tree? Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 1308 Description A tree is a well-known data structure that is either empty (n原创 2016-05-19 12:29:26 · 655 阅读 · 0 评论 -
HDU-1233-还是畅通工程(最小生成树 克鲁斯卡尔)
L - 还是畅通工程 Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1233 Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定原创 2016-05-19 12:51:30 · 418 阅读 · 0 评论 -
HDU-1875-畅通工程再续(最小生成树 普利姆)
N - 畅通工程再续 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticeHDU 1875 Description 相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百原创 2016-05-19 15:01:46 · 363 阅读 · 0 评论 -
POJ-1287-Networking(最小生成树 普利姆)
B - Networking Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u SubmitStatusPracticePOJ 1287 Description You are assigned to design network connections between certain p原创 2016-05-21 15:55:52 · 382 阅读 · 0 评论 -
CodeForces 731C-Socks(联通图 并查集)
C. Socks time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Arseniy is already grown-up and independent. His mother decided to leave him alon原创 2016-11-24 17:38:53 · 359 阅读 · 0 评论