zoukankan      html  css  js  c++  java
  • uva 12034 Race

    #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
    ",cas,f[n]);
        }
        return 0;
    }
  • 相关阅读:
    ADO.NET调用存储过程
    存储过程
    web Servise(服务)
    ADO.NET连接池
    ADO.NET
    常用语法2
    常用语法
    修改pip源为国内网站
    模块
    random模块
  • 原文地址:https://www.cnblogs.com/gccbuaa/p/7149978.html
Copyright © 2011-2022 走看看