- 博客(8)
- 资源 (1)
- 收藏
- 关注
原创 HDU 3371 Connect the Cities
http://acm.hdu.edu.cn/showproblem.php?pid=3371输入一个T,代表有总共有T组测试数据,接下来一行输入n,m,k,其中n(3最小生成树问题#include#includeusing namespace std;#define M 1000000int a[600][600],aa[600],n;void
2012-03-26 22:10:29 421
原创 HDU2680 Choose the best route
http://acm.hdu.edu.cn/showproblem.php?pid=2680题目大意:给你一个有向图,一个起点集合,一个终点,求最短路。自己多加一个超级源点,把起点集合连接到超级源点上,然后将起点与超级源点的集合的路径长度设为0, 然后求最短路。#include#includeusing namespace std
2012-03-26 21:58:40 275
原创 FOJ 2074 Number of methods
http://acm.fzu.edu.cn/problem.php?pid=2074#include #include #include #includeusing namespace std;int main(){ //freopen("a","r",stdin); int f[200],i; f[1]=1; f[2]=2;
2012-03-26 21:42:52 385
原创 HDU3631 Shortest Path
http://acm.hdu.edu.cn/showproblem.php?pid=3631题意:给一个图。接着是M个操作,有两种:1.标记某个点2.求某两点间的最短路径,要求该路径通过被标记的点。利用弗洛伊德算法思想,每次新标记一个点时,判断以下该点是否会对其他两点间的距离造成影响。#include#includeusing namespace std;#de
2012-03-18 23:13:22 348
原创 [HDU]2444 The Accomodation of Students二分图最大流匹配模板
http://acm.hdu.edu.cn/showproblem.php?pid=2444题意:一堆学生中存在一些相互认识的pair,问能否将这些学生分成两部分,使得每部分中的学生互相都不认识。先判断是否为二分图,对每对点标记两种颜色。如果出现染色矛盾情况则说明不是二分图,此时需要继续读完输入数据。是二分图后用最大流完成二分图的最大匹配。#include #
2012-03-18 22:24:12 381
原创 SOJ1950 Brain Teasers
http://www.soj.me/1950#include#include#include#include#includeusing namespace std;const int maxn=200;struct bign{ int len,s[maxn]; bign() { memset(s,0,sizeof(s));
2012-03-16 22:44:39 350
原创 zoj3583 Simple Path
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3583题意:给定一无向图和图中两点,统计该图中不在连接这两点的简单路径上的点的个数。直接搜索,若该点可到达目标点,则该路径上点均可到达目标点,搜索便可停止。#include#includeusing namespace std;int n,
2012-03-14 23:02:49 320
原创 SOJ1802 Atomic Nucleus Investigation
http://www.soj.me/show_problem.php?pid=1802题意:维护一个整数的集合,有以下操作:1.插入一个数,若已存在则不操作。2.删除一个数,若不存在则不操作。3.输出当前集合中两数差的最小值。简单线段树#include#include#includeusing namespace std;#define N 1
2012-03-14 20:29:40 453
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人