SDNU 1311.Binomial Coeffcients 杨辉三角算组合数

这道题目要求计算C(n, k)模10000003,通过杨辉三角的性质来实现。利用C(n, k) = C(n-1, k-1) + C(n-1, k)进行递推,先生成杨辉三角的部分表,然后根据给定的n和k计算结果。" 101346025,1392973,Cucumber入门与Gherkin语法详解,"['测试框架', 'Cucumber', 'BDD实践', '自动化测试', 'Gherkin语法']
摘要由CSDN通过智能技术生成

1311.Binomial Coeffcients

Description

The binomial coefficientis the number of ways of picking k unordered outcomes from n possibilities, also known as a combination or combinatorial number.

       Give n and k, you are required to calculate  mod 10000003.


Input

The input contains several test cases. The first line of the input contains one positive integer, c, denoting the number of test cases.

       Each of the following c lines contains two integers, n(0<=n<=1000) and k (0<=k<=n), denoting that you are required to calculate

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值