22093_BinomialShowdown

2022-5-16 18:21| 发布者: Hocassian| 查看: 28| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-89506105042300-Problem List-采集的数据-后羿采集器.html

Pro.ID

22093

Title

Binomial Showdown

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22093

AC

26

Submit

80

Ratio

32.50%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    In how many ways can you choose k elements out of n elements, not taking order into account?
    Write a program to compute this number.

    输入

    The input will contain one or more test cases.
    Each test case consists of one line containing two integers n ( n ≥ 1 ) and k ( 0 ≤ k ≤ n ).
    Input is terminated by two zeroes for n and k.

    输出

    Description

    In how many ways can you choose k elements out of n elements, not taking order into account?
    Write a program to compute this number.

    Input

    The input will contain one or more test cases.
    Each test case consists of one line containing two integers n ( n ≥ 1 ) and k ( 0 ≤ k ≤ n ).
    Input is terminated by two zeroes for n and k.

    Output

    For each test case, print one line containing the required number. This number will always fit into an integer, i.e. it will be less than 231.
    Warning: Don't underestimate the problem. The result will fit into an integer ---- but if all intermediate results arising during the computation will also fit into an integer depends on your algorithm. The test cases will go to the limit.

    Sample Input
    4 2
    10 5
    49 6
    0 0
    Sample Output
    6
    252
    13983816
    Source

    样例输入

    4 2
    10 5
    49 6
    0 0

    样例输出

    6
    252
    13983816

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部