uva 12034 Race
来源:互联网 发布:音频转码软件 编辑:程序博客网 时间:2024/06/05 07:49
#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <stack>#include <set>#include <map>#include <string>#include <math.h>#include <stdlib.h>#include <time.h>using namespace std;const int M=10056;const int N=1024;int c[N][N];int main(){ int f[N],cas,t,i,j,n; for(i=0;i<N;i++) { c[i][0]=c[i][i]=1; for(j=1;j<i;j++) { c[i][j]=(c[i-1][j-1]+c[i-1][j])%M; } } f[0]=1; for(i=1;i<N;i++) { f[i]=0; for(j=1;j<=i;j++) { f[i]=(f[i]+c[i][j]*f[i-j])%M; } } scanf("%d",&t); for(cas=1;cas<=t;cas++) { scanf("%d",&n); printf("Case %d: %d\n",cas,f[n]); } return 0;}
0 0
- UVa 12034 - Race
- UVA - 12034 Race
- UVA 12034 Race
- UVA 12034 Race
- UVA 12034-Race
- uva 12034 Race
- UVA 12034(p332)----Race
- uva 12034 Race
- UVA 12034 Race
- UVA 12034 Race
- UVa 12034 Race
- UVa 12034 Race
- UVA 12034 Race
- UVA 12034 Race
- uva 12034 Race(dp)
- UVA 12034 - Race(递推)
- uva 12034 - Race(dp计数)
- Race - UVa 12034 递推
- 删除Xcode中多余的证书provisioning profile
- Linux定时器分析-源码sample
- hdu2289 Cup(二分)
- 跨进程操作tab control标签页选择
- 广播机制(一)
- uva 12034 Race
- 关于 CCS 6.0 Content Assist 的问题
- 关于特征值和特征向量的新理解
- openrisc u-boot移植
- github clone Permission denied (publickey).
- .pb.h:9:42: fatal error: google/protobuf/stubs/common.h: No such file or directory
- 15HA_OJ——不容易系列之(3)—— LELE的RPG难题
- Linux最常用的20条命令
- CCS V6.0 不能生成TXT文件的解决方法