hdoj_2049 不容易系列之(4)——考新郎
2013-06-02 20:54
363 查看
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2049
//C++代码 #include<iostream> #include<cstdio> using namespace std; int main(){ int C,n,m,k,i; __int64 t,f[21]; f[1]=0,f[2]=1; for(i=3;i<=20;i++) f[i]=(i-1)*(f[i-1]+f[i-2]); cin>>C; while(C--){ cin>>n>>m; t=1; k=n-m; for(i=1;i<=n-m;i++) t=t*(n+1-i)/i; printf("%I64d\n",t*f[m]); } return 0; }
相关文章推荐
- HDOJ 2049 不容易系列之(4)——考新郎
- hdoj-2049-不容易系列之(4)——考新郎
- hdoj 2049 不容易系列之(4)——考新郎 【全错位排列】【组合数】
- hdoj2049不容易系列之(4)——考新郎
- HDOJ 2049 不容易系列之(4)——考新郎
- hdoj.2049 不容易系列之(4)——考新郎 20140805
- HDOJ 2049 不容易系列之(4)——考新郎
- hdoj 2049 不容易系列之(4)——考新郎 【排列组合+全排列】
- hdoj-2049-不容易系列之(4)——考新郎
- 错排问题系列之 不容易系列之(4)——考新郎 hdoj 2049
- 错排公式与hdoj2049 不容易系列之(4)——考新郎
- HDOJ 2049 不容易系列之(4)——考新郎
- hdoj 2049 不容易系列之(4)——考新郎
- hdoj2049 不容易系列之(4)——考新郎
- hdoj 2049 不容易系列之(4)——考新郎
- HDOJ 2049 不容易系列之(4)——考新郎(排列组合+错排公式)
- HDOJ 不容易系列之(4)——考新郎 2049(错排)
- HDOJ 2049 不容易系列之(4)——考新郎
- hdoj-2049(不容易系列之(4)——考新郎)(全错位排列+排列组合)
- HDOJ2049 不容易系列之(4)——考新郎