zoukankan      html  css  js  c++  java
  • POJ 1306 Combinations

    // 求 C[n][m]
    // 组合公式 C[i][j]=C[i-1][j-1]+C[i-1][j];
    #include <iostream>
    #include <string>
    #include<sstream>
    #include <cmath>
    #include <map>
    #include <stdio.h>
    #include <string.h>
    #include <algorithm>
    using namespace std;
    #define  LL long long
    LL C[123][123];
    int main()
    {
       int i,j;
       for(i=0;i<=100;i++) C[i][0]=1;
       for(i=1;i<=100;i++)
         for(j=1;j<=i;j++)
           C[i][j]=C[i-1][j-1]+C[i-1][j];
       int n,k;
       while(scanf("%d %d",&n,&k),n|k)
       {
          printf("%d things taken %d at a time is %lld exactly.
    ",n,k,C[n][k]);
       }
       return 0;
    }
  • 相关阅读:
    灌注和宝石性道法价比分析
    bzoj1912
    bzoj3504
    poj3580
    bzoj1251
    bzoj3223
    bzoj1212
    bzoj3790
    记一次惨痛的比赛
    bzoj2734
  • 原文地址:https://www.cnblogs.com/372465774y/p/3603215.html
Copyright © 2011-2022 走看看