Coldfresh的博客

keeeeeep!~

【51nod】小k的技术(tarjan+带权并查集)

思路:用tarjan缩点以后,在带权并查集,需判断一个并查集里,是否含有强连通分量,如果有贡献就是点集大小,如果没有减1. 代码: #include<iostream> #include<cstdio&amp...

2018-09-04 19:14:30

阅读数:14

评论数:0

(codevs)1540 银河英雄传说 2002年NOI全国竞赛(扩展域的并查集)

题目描述 Description 公元五八○一年,地球居民迁移至金牛座α第二行星,在那里发表银河联邦创立宣言,同年改元为宇宙历元年,并开始向银河系深处拓展。 宇宙历七九九年,银河系的两大军事集团在巴米利恩星域爆发战争。泰山压顶集团派宇宙舰队司令莱因哈特率领十万余艘战舰出征,气吞山河集团点名将杨...

2018-05-02 20:40:44

阅读数:28

评论数:0

In Touch HDU- 5361(最短路+并查集)

There are n soda living in a straight line. soda are numbered by 1,2,…,n from left to right. The distance between two adjacent soda is 1 meter. Every...

2018-04-05 14:37:10

阅读数:34

评论数:0

Parity game POJ - 1733 (离散化+种类并查集)

Now and then you play the following game with your friend. Your friend writes down a sequence consisting of zeroes and ones. You choose a continuous ...

2018-04-04 17:40:00

阅读数:19

评论数:0

Minimum spanning tree for each edge CodeForces - 609E(ST算法+树链剖分(或倍增LCA)+最小生成树)

Connected undirected weighted graph without self-loops and multiple edges is given. Graph contains n vertices and m edges. For each edge (u, v) find...

2018-03-21 13:49:34

阅读数:76

评论数:0

(pat)A1107. Social Clusters

When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A “soc...

2018-03-13 17:50:18

阅读数:56

评论数:0

Marriage Match II HDU - 3081 (二分答案+最大流+并查集)

Presumably, you all have known the question of stable marriage match. A girl will choose a boy; it is similar as the game of playing house we used to...

2017-10-30 18:14:36

阅读数:84

评论数:0

Conquer a New Region HDU - 4424(带权并查集的dp)

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 ...

2017-09-29 21:51:53

阅读数:188

评论数:0

Travel HDU - 5441 (带权并查集+离线)

Jack likes to travel around the world, but he doesn’t like to wait. Now, he is traveling in the Undirected Kingdom. There are nn cities and mm bidire...

2017-09-22 14:28:47

阅读数:122

评论数:0

A Bug's Life HDU - 1829 (并查集)

Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and th...

2017-09-21 17:37:55

阅读数:99

评论数:0

FFF at Valentine HDU - 6165 (并查集+tarjan+缩点+拓扑排序)

At Valentine’s eve, Shylock and Lucar were enjoying their time as any other couples. Suddenly, LSH, Boss of FFF Group caught both of them, and locked...

2017-08-24 21:28:37

阅读数:159

评论数:0

How Many Answers Are Wrong HDU - 3038(种类并查集)

TT and FF are … friends. Uh… very very good friends -__-b FF is a bad boy, he is always wooing TT to play the following game with him. This is a very...

2017-07-23 19:38:12

阅读数:115

评论数:0

食物链 POJ - 1182(种类并查集)

动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是”1 X Y”,表示X和Y是同...

2017-07-23 19:35:35

阅读数:116

评论数:0

危险系数(又名:风险度量)(并查集)

问题描述 抗日战争时期,冀中平原的地道战曾发挥重要作用。地道的多个站点间有通道连接,形成了庞大的网络。但也有隐患,当敌人发现了某个站点后,其它站点间可能因此会失去联系。我们来定义一个危险系数DF(x,y):对于两个站点x和y (x != y), 如果能找到一个站点z,当z被敌人破坏后,x和y不连...

2017-04-07 00:32:43

阅读数:247

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭