2014年3月5日

hdu 1189 并查集

摘要: Farm IrrigationTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4802Accepted Submission(s): 2073Problem DescriptionBenny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. W... 阅读全文

posted @ 2014-03-05 22:00 雄.. 阅读(220) 评论(0) 推荐(0)

hdu 1272 并查集

摘要: 题目大意:给一个图,不能出现环,而且只能有一个联通子图。好惆怅,又是爆栈又是wrong answer的。#include#includeusing namespace std;const int maxn=100005;int f[maxn],ans;bool v[maxn];void init(){for(int i=1;ifb) f[fa]=fb; else f[fb]=fa;}int main(){ int a,b,i,sum; while(scanf("%d %d",&a,&b) && !(a==-1 && b==-1 阅读全文

posted @ 2014-03-05 21:02 雄.. 阅读(164) 评论(0) 推荐(0)

hdu 1856 并查集

摘要: More is betterTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 327680/102400 K (Java/Others)Total Submission(s): 11865Accepted Submission(s): 4395Problem DescriptionMr Wang wants some boys to help him with a project. Because the project is rather complex,the more boys come, the bett... 阅读全文

posted @ 2014-03-05 19:09 雄.. 阅读(299) 评论(0) 推荐(0)

导航