摘要:
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1241最基本的图论问题DFS 和BFS都能做DFSView Code 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 #define maxn 107 5 char map[maxn][maxn];//邻接矩阵存图 6 int visit[maxn][maxn];//标记节点是否被访问过0表示未被访问过1表示访问过 7 int dir[8][2] = {{0,1},{1,1},{- 阅读全文
posted @ 2012-08-03 17:53
时光旅行的懒猫
阅读(189)
评论(0)
推荐(0)
摘要:
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1047多个数的大数相加问题View Code 1 #include<stdio.h> 2 #include<string.h> 3 int a[100000]; 4 char b[100000]; 5 int main() 6 { 7 int n,i,j,t,max; 8 scanf("%d",&n); 9 getchar();10 while(n--)11 {12 memset(a,0,sizeof(a));13 while(... 阅读全文
posted @ 2012-08-03 17:48
时光旅行的懒猫
阅读(169)
评论(0)
推荐(0)
摘要:
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1028思路 整数的划分问题 和分苹果问题应该差不多。套用组合数学母函数模板View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 int main() 4 { 5 int num1[200]; 6 int num2[200]; 7 int n,i,j,k; 8 while(~scanf("%d",&n)) 9 {10 for(i=0;i<=n;i++)11 {12 ... 阅读全文
posted @ 2012-08-03 17:46
时光旅行的懒猫
阅读(185)
评论(0)
推荐(0)

浙公网安备 33010602011771号