Qiuqiqiu  
不管道路多么崎岖坎坷,我永远不停下追逐梦想的脚步!

2011年12月2日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3625斯特林(stirling)数我的代码 1 #include <stdio.h> 2 #include <string.h> 3 const int N=21; 4 double s[N][N],f[N]; 5 void stir() 6 { 7 memset(s,0,sizeof(s)); 8 s[1][1]=1; 9 int i,j;10 for (i=2;i<N;i++)11 for (j=1;j<=i;j++)12 s[i][... 阅读全文
posted @ 2011-12-02 22:56 Qiuqiqiu 阅读(235) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1023卡塔兰(Catalan)数我的代码 1 #include <stdio.h> 2 #include <string.h> 3 const int L=100,base=100000; 4 void print(int *a) 5 { 6 printf("%d",a[a[0]]); 7 for (int i=a[0]-1;i>0;i--) printf("%05d",a[i]); 8 printf("\n"); 9 阅读全文
posted @ 2011-12-02 22:54 Qiuqiqiu 阅读(188) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1879并查集我的代码 1 #include <stdio.h> 2 #include <stdlib.h> 3 const int M=10000,N=110; 4 struct edge 5 { 6 int u,v,w; 7 }e[M]; 8 int set[N],n,m; 9 int cmp(const void *a,const void *b)10 {11 return ((edge*)a)->w - ((edge*)b)->w;12 }13 int find(in 阅读全文
posted @ 2011-12-02 10:29 Qiuqiqiu 阅读(237) 评论(0) 推荐(1) 编辑