- 博客(15)
- 资源 (4)
- 收藏
- 关注
原创 hdu1016 (素数环)(深度优先搜索)另附:http://acm.nyist.net/JudgeOnline/problem.php?pid=488
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1016 http://acm.nyist.net/JudgeOnline/problem.php?pid=488(1的时候形成自环)源代码:#include#include#includeusing namespace std;#define N
2012-08-15 20:22:55
1840
原创 poj2751(双机调度)
http://poj.org/problem?id=2751源代码:#include#include#include#includeusing namespace std;#define N 10001struct node{ int flag,t,id; bool operator { return t }};int a[N];
2012-08-14 20:20:49
463
原创 poj3628(背包变形)
http://poj.org/problem?id=3628源代码:#include#include#includeusing namespace std;const int INF =20000001;#define N 21int height[N];int dp[INF];void dp1(int n,int sum,int height[]);i
2012-08-14 20:18:52
325
原创 poj3624(背包问题)
http://poj.org/problem?id=3624源代码:#include#include#includeusing namespace std;#define N 3410int m[N][N];int w[N];int v[N];int max(int a,int b);int min(int a,int b);
2012-08-14 20:16:30
369
原创 hdu1875(MST)(prim)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1875源代码:#include#include#include#includeusing namespace std;#define INF 999999#define N 110double edge[N][N];double dist[N];int visit
2012-08-14 19:40:25
292
原创 hdu1102(MST)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1102源代码://之前的总是stack_overflow,无语啊#include#include#include#includeusing namespace std;#define INF 9999999int village[101];int ed
2012-08-14 09:24:36
349
原创 hdu1257 另附:http://acm.nyist.net/JudgeOnline/problem.php?pid=214(最长上升子序列)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1257 http://acm.nyist.net/JudgeOnline/problem.php?pid=214(代码大同小异,不再赘述,但要注意时间复杂度)源代码:#include#include#includeusing namespace std;#de
2012-08-12 19:56:36
468
原创 hdu1025(最长上升子序列)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1025另附:http://acm.nyist.net/JudgeOnline/problem.php?pid=17源代码:#include#include#includeusing namespace std;#define N 500005int b
2012-08-12 19:54:33
458
原创 hdu1159 另附:http://acm.nyist.net/JudgeOnline/problem.php?pid=36(最长公共子序列)
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=36http://acm.hdu.edu.cn/showproblem.php?pid=1159源代码:#include#include#include#includeusing namespace std;#define N 500char
2012-08-12 10:11:08
823
原创 hdu1233(prim求最小生成树)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1233源代码:#include#include#includeusing namespace std;#define N 100#define max 99999int edge[N][N];int dist[N];int visited[N];int main(
2012-08-12 09:57:32
379
原创 hdu1879(kruskal求最小生成树)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1879源代码:#include#include#include#includeusing namespace std;typedef struct Edge{ int start,end,weight,flag;}edge;edge e[5000];int
2012-08-12 09:51:25
310
原创 hdu1863(kruskal求最小生成树)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1863源代码:#include#include#include#includeusing namespace std;#define N 100typedef struct Edge{int c1,c2,value;}edge;edge e
2012-08-12 09:49:32
277
原创 zju3033(bellman_ford)
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3033源代码:#include #include #include #define N 310#define inf ( (long long)(1) )#define LL long longusing namespace std;
2012-08-11 23:21:17
214
原创 hdu2191(多重背包)
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=2191源代码:#include#include#includeusing namespace std;#define N 101int w[N];int v[N];int multiple_pack[N];int a[N];int main()
2012-08-11 21:26:57
253
原创 hdu1114,poj1384(完全背包)另附:http://acm.nyist.net/JudgeOnline/problem.php?pid=311
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1114 http://poj.org/problem?id=1384http://acm.nyist.net/JudgeOnline/problem.php?pid=311(代码雷同,不再赘述)#include#include#includeusing namespa
2012-08-11 20:26:26
495
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人