并查集
文章平均质量分 77
乐着过一辈子
这个作者很懒,什么都没留下…
展开
-
POJ2513【并查集+字典树+欧拉】
/*Colored Sticks Time Limit : 10000/5000ms (Java/Other) Memory Limit : 256000/128000K (Java/Other)Total Submission(s) : 0 Accepted Submission(s) : 0Problem DescriptionYou are given a bunch of原创 2015-04-14 13:36:35 · 397 阅读 · 0 评论 -
Hduoj1162【最小生成树】
/*Eddy's picture Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 0 Accepted Submission(s) : 0Font: Times New Roman | Verdana | Georgia Font原创 2014-11-14 13:33:43 · 355 阅读 · 0 评论 -
Poj1251【最小生成树】
Jungle Roads Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 4 Accepted Submission(s) : 2Font: Times New Roman | Verdana | Georgia Font原创 2014-11-13 19:50:10 · 392 阅读 · 0 评论 -
Hduoj2682【最小生成树】
/*Tree Time Limit : 6000/2000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 24 Accepted Submission(s) : 9Font: Times New Roman | Verdana | Georgia Font Size: ← →原创 2015-03-26 18:56:37 · 365 阅读 · 0 评论 -
Hduoj1241【搜索 或 并查集】
Oil DepositsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13004 Accepted Submission(s): 7536Problem DescriptionThe GeoSurvComp原创 2014-11-24 17:46:42 · 372 阅读 · 0 评论 -
Hduoj2818【带权并查集】
/*Building BlockTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3894 Accepted Submission(s): 1209Problem DescriptionJohn are playing wi原创 2015-07-21 10:45:41 · 438 阅读 · 0 评论 -
Hduoj3635【带权并查集】
/*Dragon Balls Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 0 Accepted Submission(s) : 0Problem DescriptionFive hundred years later, the原创 2015-07-23 16:04:41 · 322 阅读 · 0 评论 -
Hduoj1301【最小生成树】
#include#include #include#define MAX 100000000int n, f[27], m;struct road{ int a, b, dis;}r[80];int find(int x){ if(x != f[x]) f[x] = find(f[x]); return f[x];}int merge(int x, int y){原创 2015-04-01 13:47:56 · 391 阅读 · 0 评论 -
Hdu3371【最小生成树】
/*Connect the Cities Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 0 Accepted Submission(s) : 0Font: Times New Roman | Verdana | Georgia F原创 2014-11-12 18:38:56 · 369 阅读 · 0 评论 -
VJ【并查集】
/*DescriptionDima and Inna love spending time together. The problem is, Seryozha isn't too enthusiastic to leave his room for some reason. But Dima and Inna love each other so much that they decided原创 2016-04-01 22:02:16 · 410 阅读 · 0 评论 -
Hduoj1198【最小生成树】
Farm IrrigationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6024 Accepted Submission(s): 2603Problem DescriptionBenny has a sp原创 2014-11-14 23:16:37 · 431 阅读 · 0 评论 -
Hduoj1829【并查集】
/*A Bug's Life Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9249 Accepted Submission(s): 2980Problem DescriptionBackground Profess原创 2014-12-01 15:20:06 · 441 阅读 · 0 评论 -
Hduoj1875 【并查集】
/*畅通工程再续Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15891 Accepted Submission(s): 4914Problem Description相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生原创 2014-10-19 17:12:17 · 423 阅读 · 0 评论 -
Hduoj1879 【并查集】
/*继续畅通工程Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 14325 Accepted Submission(s): 6235Problem Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以原创 2014-10-19 15:52:29 · 360 阅读 · 0 评论 -
Hduoj1233 【并查集】
/*还是畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 26716 Accepted Submission(s): 11930Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村原创 2014-10-19 11:55:57 · 404 阅读 · 0 评论 -
Hduoj 1863【并查集】
#include #include#includestruct point{ int x; int y; int cost;}po[5050];int c[110];int cmp(const void *a, const void *b){ return (*(struct point*)a).cost - (*(struct point*)b).cost;}int原创 2014-10-19 11:35:44 · 408 阅读 · 0 评论 -
hduoj1232!【并查集】
/*畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30393 Accepted Submission(s): 15962Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,原创 2014-08-05 10:01:17 · 385 阅读 · 0 评论 -
Hduoj3172【字典树+并查集】
#include#include#include#includeint f[200010], n, idnum, sum[200010];struct tree{ int id; tree *next[52];}root;int finds(char *s){ tree *p = &root, *q; int i, j,原创 2015-05-01 17:30:47 · 361 阅读 · 0 评论 -
Hduoj1272【并查集+路径压缩】
/*小希的迷宫 Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 21 Accepted Submission(s) : 7Font: Times New Roman | Verdana | Georgia Font Size: ←原创 2015-04-02 18:34:41 · 372 阅读 · 0 评论 -
Hduoj4786【最小生成树】
#include#includestruct point{ int x, y, o;}P[100010] ;int f[100010], F[33];void get_Fib(){ F[1] = 1; F[2] = 2; for(int i = 3; F[i] <= 30; ++i) F[i] = F[i-1] + F[i-2];}int find(int x){原创 2015-03-30 11:00:58 · 391 阅读 · 0 评论 -
Hduoj3047【带权并查集】
/*Zjnu Stadium Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 0 Accepted Submission(s) : 0Font: Times New Roman | Verdana | Georgia Font Si原创 2015-02-15 10:33:58 · 338 阅读 · 0 评论 -
安慰奶牛【最小生成树】
问题描述Farmer John变得非常懒,他不想再继续维护供奶牛之间供通行的道路。道路被用来连接N个牧场,牧场被连续地编号为1到N。每一个牧场都是一个奶牛的家。FJ计划除去P条道路中尽可能多的道路,但是还要保持牧场之间 的连通性。你首先要决定那些道路是需要保留的N-1条道路。第j条双向道路连接了牧场Sj和Ej(1 j j j != Ej),而且走完它需要Lj的时间。没有两个牧场是被一条以上原创 2016-05-16 19:03:55 · 492 阅读 · 0 评论