
并查集
文章平均质量分 80
kyoma
这个kyoma就是逊啦
展开
-
hdoj1272 小希的迷宫 裸并查集
Problem Description??Gardon?????????????Problem B??????????????Gardon????????????????????????????????????????????????????A?B????????????A????B??????????B????A??????????????????????????????????????原创 2016-08-01 16:27:39 · 485 阅读 · 1 评论 -
CODE FESTIVAL 2017 qual B:C - 3 Steps 并查集判二分图、二分图性质
题目链接 题意:给一个连通的无向图,让我们往距离为三的两个不同的点添加一条边,问最终能够添加多少条边 比赛时做的没想法,官方题解讲得很清楚假设在ss和t之间存在一条长度为奇数的路径,也就是说对于某个奇数t之间存在一条长度为奇数的路径,也就是说对于某个奇数k,存在一个点的序列,存在一个点的序列s=v0,v1,...,vk=t=v_0,v_1,...,v_k=t(viv_i和vi+1v_{i+1}相原创 2017-10-24 23:48:19 · 311 阅读 · 0 评论 -
Mutual Training for Wannafly Union #6 A(bfs)/B(规律)/E (并查集)
阿三们的oj呢,第一次印度的题。托这个服,根本查不到题解呢^q^。D题想了一半没有继续下去,太可惜了。。。。有意思的阿三oj的题号居然不是数字,而是字母组成的,o mo shi ro iA - Grid (spoj id:SERGRID)You are on an nxm grid where each square on the grid has a digi原创 2017-03-09 15:31:12 · 563 阅读 · 0 评论 -
AOJ2170 Marked Ancestor 并查集
You are given a tree T that consists of N nodes. Each node is numbered from 1 to N, and node 1 is always the root node of T. Consider the following two operations on T:M v: (Mark) Mark node v.Q原创 2017-01-18 23:20:10 · 670 阅读 · 0 评论 -
hdu4496 D-City 并查集
D-CityTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 4015 Accepted Submission(s): 1440Problem DescriptionLuxer is a really b原创 2017-01-18 23:08:47 · 411 阅读 · 0 评论 -
Codeforces 745C - Hongcow Builds A Nation 并查集乱搞,注意路径压缩
原题:http://codeforces.com/problemset/problem/745/CC. Hongcow Builds A Nationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutput原创 2016-12-27 00:21:35 · 664 阅读 · 0 评论 -
hdu1856 More is better 并查集
More is betterTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 327680/102400 K (Java/Others)Total Submission(s): 25399 Accepted Submission(s): 9110Problem DescriptionMr Wang原创 2016-12-02 00:40:45 · 263 阅读 · 0 评论 -
hdu5326 Work 并查集
WorkTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1781 Accepted Submission(s): 1065Problem DescriptionIt’s an interes原创 2016-10-20 17:26:46 · 367 阅读 · 0 评论 -
hdoj1233 还是畅通工程
#include #include #include #include #include #include #include #include #include #include using namespace std;int pre[105];struct unit{ int u; int v; int w;}village [10005];b原创 2016-07-27 23:26:44 · 304 阅读 · 0 评论 -
hdoj1879 继续畅通工程
#include #include #include #include #include #include #include #include #include #include using namespace std;int pre[105];struct unit{ int u,v,w; int k;}village[10005];bool comp原创 2016-07-27 23:27:28 · 397 阅读 · 0 评论 -
noip 2010 关押罪犯 二分图
题目链接 题目描述 S 城现有两座监狱,一共关押着N 名罪犯,编号分别为1~N。他们之间的关系自然也极不和谐。很多罪犯之间甚至积怨已久,如果客观条件具备则随时可能爆发冲突。我们用“怨气值”(一个正整数值)来表示某两名罪犯之间的仇恨程度,怨气值越大,则这两名罪犯之间的积怨越多。如果两名怨气值为c 的罪犯被关押在同一监狱,他们俩之间会发生摩擦,并造成影响力为c 的冲突事件。 每年原创 2017-10-24 23:55:19 · 293 阅读 · 0 评论