
----并查集
文章平均质量分 83
_Occult_
物語が始まった
展开
-
ZOJ 2339 Hyperhuffman
DescriptionYou might have heard about Huffman encoding - that is the coding system that minimizes the expected length of the text if the codes for characters are required to consist of an integral原创 2015-03-26 21:25:08 · 693 阅读 · 0 评论 -
FZU 2087 统计树边
Description在图论中,树:任意两个顶点间有且只有一条路径的图。生成树:包含了图中所有顶点的一种树。最小生成树:对于连通的带权图(连通网)G,其生成树也是带权的。生成树T各边的权值总和称为该树的权,权最小的生成树称为G的最小生成树(Minimum Spanning Tree)。最小生成树可简记为MST。但是,对于一个图而言,最小生成树并不是唯一的。现在,给你一个连通原创 2016-03-03 18:33:45 · 575 阅读 · 0 评论 -
PAT (Advanced Level) Practise 1013 Battle Over Cities (25)
1013. Battle Over Cities (25)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueIt is vitally important to have all the原创 2016-03-03 21:40:56 · 543 阅读 · 0 评论 -
HDU 5631 Rikka with Graph
Problem DescriptionAs we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:Yuta has a non-direct graph wit原创 2016-02-20 21:27:33 · 705 阅读 · 0 评论 -
PAT (Advanced Level) Practise 1034 Head of a Gang (30)
1034. Head of a Gang (30)时间限制100 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueOne way that the police finds the head of a原创 2016-03-09 18:31:39 · 532 阅读 · 0 评论 -
PAT (Top Level) Practise 1001 Battle Over Cities - Hard Version (35)
1001. Battle Over Cities - Hard Version (35)时间限制800 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, YueIt is vitally important t原创 2016-02-28 11:46:42 · 4210 阅读 · 3 评论 -
PAT (Advanced Level) Practise 1091 Acute Stroke (30)
1091. Acute Stroke (30)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueOne important factor to identify acute stroke原创 2016-03-25 19:05:14 · 596 阅读 · 0 评论 -
PAT (Advanced Level) Practise 1118 Birds in Forest (25)
1118. Birds in Forest (25)时间限制150 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueSome scientists took pictures of thousands原创 2016-09-12 20:16:03 · 735 阅读 · 0 评论 -
CodeForces 691D Swaps in Permutation
DescriptionYou are given a permutation of the numbers 1, 2, ..., n and m pairs of positions (aj, bj).At each step you can choose a pair from the given positions and swap the numbers in that posi原创 2016-08-10 17:11:54 · 564 阅读 · 0 评论 -
HDU 4879 ZCC loves march
On a m*m land stationed n troops, numbered from 1 to n. The i-th troop's position can be described by two numbers (xi,yi) (1 Then there are t minutes, in each minute one of the following two events原创 2017-03-02 13:58:32 · 338 阅读 · 0 评论 -
HDU 5606 tree
Problem DescriptionThere is a tree(the tree is a connected graph which contains nn points and n-1n−1 edges),the points are labeled from 1 to nn,which edge has a weight from 0 to 1,for every原创 2016-02-02 18:50:30 · 498 阅读 · 0 评论 -
HDU 5624 KK's Reconstruction
问题描述我们可爱的KK有一道困难的社会性题目:他所在的地区发生了一场大地震(如此老套的出题思路~!),一共有N\left( 2\leq N\leq 2000\right)N(2≤N≤2000)个城市受到了牵连,NN个城市间所有道路都已损坏,现在KK受委托要重修这些道路。然而,经过KK的实地考察发现,很多城市间道路的地基都被破坏了,无法再重修道路,因此可供修建的道路只有M\left( 0\leq原创 2016-02-07 14:05:06 · 747 阅读 · 0 评论 -
HDU 1272 小希的迷宫
Problem Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路原创 2015-03-17 16:40:29 · 449 阅读 · 0 评论 -
HDU 1198 Farm Irrigation
Problem DescriptionBenny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are placed in these squares. Different square h原创 2015-03-19 23:15:20 · 427 阅读 · 0 评论 -
HDU 3635 Dragon Balls
Problem DescriptionFive hundred years later, the number of dragon balls will increase unexpectedly, so it's too difficult for Monkey King(WuKong) to gather all of the dragon balls together.原创 2015-03-19 11:40:07 · 442 阅读 · 0 评论 -
HDU 3172 Virtual Friends
Problem DescriptionThese days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people, growing their social network (their friend原创 2015-03-19 11:37:44 · 448 阅读 · 0 评论 -
HDU 2818 Building Block
Problem DescriptionJohn 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原创 2015-03-17 21:52:31 · 521 阅读 · 0 评论 -
HDU 1558 Segment set
Problem DescriptionA segment and all segments which are connected with it compose a segment set. The size of a segment set is the number of segments in it. The problem is to find the size of some原创 2015-03-20 15:45:29 · 467 阅读 · 0 评论 -
HDU 3038 How Many Answers Are Wrong
Problem DescriptionTT and FF are ... friends. Uh... very very good friends -________-bFF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game.原创 2015-03-19 11:43:59 · 498 阅读 · 0 评论 -
HDU 1829 A Bug's Life
Problem DescriptionBackground Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with b原创 2015-03-17 23:58:19 · 417 阅读 · 0 评论 -
HDU 5285 wyh2000 and pupil
Problem DescriptionYoung theoretical computer scientist wyh2000 is teaching his pupils.Wyh2000 has n pupils.Id of them are from 1 to n.In order to increase the cohesion between pupils,wyh2000原创 2015-07-18 23:54:52 · 720 阅读 · 0 评论 -
HDU 5923 Prediction
There is a graph G=⟨VG,EG⟩G=⟨VG,EG⟩ with |VG|=n|VG|=n and |EG|=m|EG|=m, and a magic tree T=⟨VT,ET⟩)T=⟨VT,ET⟩) rooted at 1, which contains m vertices. Each vertex of the magic tree correspond原创 2017-11-08 15:30:05 · 389 阅读 · 0 评论