- 博客(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 #include using namespace std; #define N
2012-08-15 20:22:55 1811
原创 poj2751(双机调度)
http://poj.org/problem?id=2751 源代码: #include #include #include #include using namespace std; #define N 10001 struct node { int flag,t,id; bool operator { return t } }; int a[N];
2012-08-14 20:20:49 439
原创 poj3628(背包变形)
http://poj.org/problem?id=3628 源代码: #include #include #include using namespace std; const int INF =20000001; #define N 21 int height[N]; int dp[INF]; void dp1(int n,int sum,int height[]); i
2012-08-14 20:18:52 298
原创 poj3624(背包问题)
http://poj.org/problem?id=3624 源代码: #include #include #include using namespace std; #define N 3410 int 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 349
原创 hdu1875(MST)(prim)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1875 源代码: #include #include #include #include using namespace std; #define INF 999999 #define N 110 double edge[N][N]; double dist[N]; int visit
2012-08-14 19:40:25 270
原创 hdu1102(MST)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1102 源代码: //之前的总是stack_overflow,无语啊 #include #include #include #include using namespace std; #define INF 9999999 int village[101]; int ed
2012-08-14 09:24:36 331
原创 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 #include using namespace std; #de
2012-08-12 19:56:36 453
原创 hdu1025(最长上升子序列)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1025 另附:http://acm.nyist.net/JudgeOnline/problem.php?pid=17 源代码: #include #include #include using namespace std; #define N 500005 int b
2012-08-12 19:54:33 440
原创 hdu1159 另附:http://acm.nyist.net/JudgeOnline/problem.php?pid=36(最长公共子序列)
题目链接: http://acm.nyist.net/JudgeOnline/problem.php?pid=36 http://acm.hdu.edu.cn/showproblem.php?pid=1159 源代码: #include #include #include #include using namespace std; #define N 500 char
2012-08-12 10:11:08 813
原创 hdu1233(prim求最小生成树)
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1233 源代码: #include #include #include using namespace std; #define N 100 #define max 99999 int edge[N][N]; int dist[N]; int visited[N]; int main(
2012-08-12 09:57:32 358
原创 hdu1879(kruskal求最小生成树)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1879 源代码: #include #include #include #include using namespace std; typedef struct Edge { int start,end,weight,flag; }edge; edge e[5000]; int
2012-08-12 09:51:25 289
原创 hdu1863(kruskal求最小生成树)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1863 源代码: #include #include #include #include using namespace std; #define N 100 typedef struct Edge { int c1,c2,value; }edge; edge e
2012-08-12 09:49:32 261
原创 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 long using namespace std;
2012-08-11 23:21:17 199
原创 hdu2191(多重背包)
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=2191 源代码: #include #include #include using namespace std; #define N 101 int w[N]; int v[N]; int multiple_pack[N]; int a[N]; int main()
2012-08-11 21:26:57 236
原创 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=1384 http://acm.nyist.net/JudgeOnline/problem.php?pid=311(代码雷同,不再赘述) #include #include #include using namespa
2012-08-11 20:26:26 473
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人