
并查集
文章平均质量分 90
mengxiang000000
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu 3081 Marriage Match II【并查集+二分+最大流Dinic+建图】
Marriage Match IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3597 Accepted Submission(s): 1165Problem DescriptionPresumably,原创 2016-08-03 16:08:32 · 1162 阅读 · 0 评论 -
Codeforces 400D. Dima and Bacteria【并查集+最短路】
D. Dima and Bacteriatime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputDima took up the biology of bacteria, as a resul原创 2016-12-19 17:46:43 · 563 阅读 · 0 评论 -
8VC Venture Cup 2017 - Elimination Round C. PolandBall and Forest【并查集】
C. PolandBall and Foresttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolandBall lives in a forest with his family.原创 2017-01-16 18:21:31 · 343 阅读 · 0 评论 -
51nod 1535 深海探险【思维+并查集】
1535 深海探险题目来源: CodeForces基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题很久很久以前的一天,一位美男子来到海边,海上狂风大作。美男子希望在海中找到美人鱼,但是很不幸他只找到了章鱼怪。 然而,在世界的另一端,人们正在积极的收集怪物的行为信息,以便研制出强大的武器来对付章原创 2017-01-17 19:22:49 · 644 阅读 · 0 评论 -
Hrbust 2222 应援团补完计划【并查集+思维】好题~
应援团补完计划Time Limit: 3000 MSMemory Limit: 32768 KTotal Submit: 9(5 users)Total Accepted: 3(3 users)Rating: Special Judge: NoDescription“因为生源骤减原创 2017-02-17 18:49:00 · 402 阅读 · 0 评论 -
【happy birthday】CSU 1326 The contest【并查集+分组背包】
1326: The contestTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 680 Solved: 213[Submit][Status]Description 殷犇有很多队员。他们都认为自己是最强的,于是,一场比赛开始了~ 于是安叔主办了一场比赛,比赛有n个题目,每个题目都有一个价值Pi和相对能力消耗Wi,原创 2017-01-18 21:13:04 · 392 阅读 · 0 评论 -
Codeforces Round #396 (Div. 2)D. Mahmoud and a Dictionary【带权并查集】
D. Mahmoud and a Dictionarytime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMahmoud wants to write a new dictionary t原创 2017-02-09 17:09:08 · 527 阅读 · 0 评论 -
玲珑学院OJ 1020 Grand Master【思维+并查集】
1020 - Grand MasterTime Limit:2s Memory Limit:64MByteSubmissions:213Solved:41DESCRIPTIONEric, the famous terrorist, wants to destroy all the cities in Byteland. There are原创 2017-02-28 11:41:17 · 492 阅读 · 0 评论 -
玲珑学院OJ 1072 Capture【并查集+优先队列】
1072 - CaptureTime Limit:15s Memory Limit:1024MByteSubmissions:545Solved:180DESCRIPTIONIn a city capture game, Mr. Van owns a Empire with a capital city ( marked 1 ). Initi原创 2017-02-28 16:42:29 · 371 阅读 · 0 评论 -
Codeforces 466E Information Graph【Dfs处理父子关系+并查集+离线查询】好题!
E. Information Graphtime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputThere are n employees working in company "X" (let原创 2017-03-02 20:44:56 · 456 阅读 · 0 评论 -
Codeforces Round #385 (Div. 2)C. Hongcow Builds A Nation【并查集+贪心】好题~
C. Hongcow Builds A Nationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHongcow is ruler of the world. A原创 2016-12-18 22:39:59 · 896 阅读 · 0 评论 -
Codeforces 699D. Fix a Tree【并查集+思维】
D. Fix a Treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA tree is an undirected connected graph without cycles.原创 2016-12-21 19:03:25 · 625 阅读 · 0 评论 -
Poj 1182 食物链【带权并查集】
食物链Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 63328 Accepted: 18577Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动原创 2016-08-04 10:17:05 · 654 阅读 · 0 评论 -
hdu 3277 Marriage Match III【并查集+最大流Dinic+拆点+建图+二分查找】
Marriage Match IIITime Limit: 10000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2019 Accepted Submission(s): 593Problem DescriptionPresumably,原创 2016-08-19 11:58:50 · 726 阅读 · 0 评论 -
Codeforces 722C Destroying Array【逆序(离线)思维+并查集】
C. Destroying Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array consisting of n non-negativ原创 2016-10-02 16:32:05 · 777 阅读 · 0 评论 -
Codeforces 278C Learning Languages【并查集】水题
C. Learning Languagestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe "BerCorp" company has got n employees. Thes原创 2016-10-31 16:05:53 · 1276 阅读 · 2 评论 -
51nod 1366 贫富差距【并查集+Floyd】
1366 贫富差距题目来源: TopCoder基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题一个国家有N个公民,标记为0,1,2,...,N-1,每个公民有一个存款额。已知每个公民有一些朋友,同时国家有一条规定朋友间的存款额之差不能大于d。也就是说,a和b是朋友的话,a有x元的存款,b有y元,那么|x-y|原创 2016-12-03 21:49:20 · 460 阅读 · 0 评论 -
Codeforces 357C Knight Tournament【并查集】
A. Knight Tournamenttime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHooray! Berl II, the king of Berland is making a原创 2016-11-24 16:45:56 · 654 阅读 · 0 评论 -
Codeforces Round #383 (Div. 2)D.Arpa's weak amphitheater and Mehrdad's valuable Hoses【并查集+分组背包】
D. Arpa's weak amphitheater and Mehrdad's valuable Hosestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputJust to remin原创 2016-12-07 12:01:57 · 502 阅读 · 0 评论 -
51nod 1416 两点【并查集】
1416 两点题目来源: CodeForces基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题福克斯在玩一款手机解迷游戏,这个游戏叫做”两点”。基础级别的时候是在一个n×m单元上玩的。像这样: 每一个单元有包含一个有色点。我们将用不同的大写字母来表示不同的颜色。这个游戏的关键是原创 2016-12-08 15:15:03 · 844 阅读 · 0 评论 -
51nod 1456 小K的技术【强连通Tarjan+缩点染色+并查集】好题~
1456 小K的技术题目来源: CodeForces基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题苏塞克王国是世界上创新技术的领先国家,在王国中有n个城市,标记为1到n。由于小K的研究,我们最终能过在两个城市之间建立传输管道,一个传输管道能单向连接两个城市,即,一个从城市x到城市y的传输管道不能被用于从城市y传输到原创 2016-12-15 15:04:21 · 952 阅读 · 3 评论 -
Codeforces Round #395(Div. 2)C. Timofey and a tree【思维+并查集缩点+判定】
C. Timofey and a treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEach New Year Timofey and his friends cut down原创 2017-02-03 15:30:50 · 695 阅读 · 0 评论 -
BZOJ 1821 Group 部落划分 Group【二分+并查集】
1821: [JSOI2010]Group 部落划分 GroupTime Limit: 10 Sec Memory Limit: 64 MBSubmit: 2170 Solved: 1028[Submit][Status][Discuss]Description聪聪研究发现,荒岛野人总是过着群居的生活,但是,并不是整个荒岛上的所有野人都属于同一个部落,野人们总是拉帮结派原创 2017-02-03 17:26:45 · 488 阅读 · 0 评论 -
Codeforces 828C String Reconstruction【思维+并查集】
C. String Reconstructiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIvan had string s consisting of small Englis原创 2017-07-13 15:58:49 · 815 阅读 · 0 评论 -
Codeforces 734E Anton and Tree【并查集缩点+树的直径】好题~
E. Anton and Treetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnton is growing a tree in his garden. In case you原创 2017-06-27 14:16:40 · 519 阅读 · 0 评论 -
Hrbust 1619 只有矩形【逆序思维+枚举+并查集优化】
只有矩形Time Limit: 1000 MSMemory Limit: 131072 KTotal Submit: 19(10 users)Total Accepted: 12(8 users)Rating: Special Judge: NoDescription一块屏幕上有原创 2017-06-15 13:10:50 · 365 阅读 · 0 评论 -
Codeforces 854C Planning【贪心+并查集】
C. Planningtime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputHelen works in Metropolis airport. She is respon原创 2017-09-07 13:07:30 · 821 阅读 · 0 评论 -
Codeforces 160D Edges in MST【思维+并查集+求桥(有重边)】
D. Edges in MSTtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a connected weighted undirect原创 2017-09-07 19:30:58 · 1607 阅读 · 0 评论 -
Hrbust 1537 安置囚犯【并查集+二维费用背包】
安置囚犯Time Limit: 1000 MSMemory Limit: 65535 KTotal Submit: 7(5 users)Total Accepted: 4(4 users)Rating: Special Judge: NoDescription为了降低出现暴动及逃原创 2017-09-20 17:28:25 · 279 阅读 · 0 评论 -
Codeforces 445B DZY Loves Chemistry【并查集】
B. DZY Loves Chemistrytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputDZY loves chemistry, and he enjoys mixing chemi原创 2016-09-29 16:52:27 · 569 阅读 · 0 评论 -
Codeforces 455E Civilization【思维+树的直径+并查集】
E. Civilizationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAndrew plays a game called "Civilization". D原创 2017-09-30 15:38:11 · 342 阅读 · 0 评论 -
GYM 101243 F.Vitamins【思维+并查集】
题目大意:现在有N个物品,已知有M个信息,表示两个物品谁更重,或者一样重,现在有三种重量,WRB,从大到小递减,问我们能够确定哪些物品的重量,如果不确定的,输出?否则输出其重量的等级(W/R/B);保证没有环,也没有非法情况思路:如果能够确定一个物品的重量,那么这个物品一定处于一条长度为2的链子上,那么我们可以O(n)枚举个点,判断其是否在这个长度为2的链子的中间点上即原创 2017-10-01 15:30:03 · 754 阅读 · 0 评论 -
Hrbust 1849 商品中心【贪心+思维+并查集】好题!好题!
商品中心Time Limit: 2000 MSMemory Limit: 32768 KTotal Submit: 7(5 users)Total Accepted: 3(3 users)Rating: Special Judge: NoDescription有N个城镇(编号从1原创 2017-06-24 21:20:19 · 548 阅读 · 0 评论 -
Codeforces 371D Vessels【思维+并查集】经典套路题
D. Vesselstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a system of n vessels arranged one above the othe原创 2017-07-10 17:20:18 · 845 阅读 · 1 评论 -
Codeforces 691D Swaps in Permutation【并查集+优先队列+贪心】
D. Swaps in Permutationtime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a permutation of the numbers 1,原创 2017-03-28 12:35:42 · 549 阅读 · 0 评论 -
Codeforces 362D Fools and Foolproof Roads【并查集+优先队列+思维】
D. Fools and Foolproof Roadstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou must have heard all about the Foollan原创 2017-04-09 13:07:37 · 437 阅读 · 0 评论 -
Codeforces Round #407(Div. 2)D. Weird journey【思维+并查集】
D. Weird journeytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle boy Igor wants to become a traveller. At firs原创 2017-03-30 20:01:45 · 553 阅读 · 0 评论 -
Codeforces 469D Two Sets【思维+并查集】
D. Two Setstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle X has n distinct integers: p1, p2, ..., pn. He wa原创 2017-05-01 19:39:54 · 928 阅读 · 0 评论 -
ZZULIOJ 1881 蛤玮的机房【并查集】水题
1881: 蛤玮的机房Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 544 Solved: 225SubmitStatusWeb BoardDescription蛤玮成为了实验室主任,现在学校要求他建好一个机房里的通信网络.这个网络中有n台主机,现在已知建设好了m条线路,可以让一些主机直接或间接通信,为了使这n台主机原创 2017-05-24 18:45:40 · 313 阅读 · 0 评论 -
玲珑学院OJ 1126 - 咸鱼旅行【二分+并查集】
1126 - 咸鱼旅行Time Limit:3s Memory Limit:128MByteSubmissions:457Solved:76DESCRIPTION这个地区可以看作是一个无向图,N个点M条边组成。每个边有一个边权。我们定义一条路径的花费,就是这条路径上最大的边权。现在有一条咸鱼,想从S走到T,徒步旅行。咸鱼于是找到了你,原创 2017-05-30 18:51:45 · 908 阅读 · 0 评论