Rosalind第27题: Partial Permutations

Problem

partial permutation is an ordering of only  objects taken from a collection containing  objects (i.e., ). For example, one partial permutation of three of the first eight positive integers is given by .

The statistic  counts the total number of partial permutations of  objects that can be formed from a collection of  objects. Note that  is just the number of permutations of objects, which we found to be equal to  in “Enumerating Gene Orders”.

Given: Positive integers  and  such that  and .

Return: The total number of partial permutations , modulo 1,000,000.

局部排列是唯一的排序对象从含集合取对象(即,)。例如,前八个正整数中的三个正整数的一个部分置换由给出。

统计数据统计可以从对象集合中形成的对象的部分排列总数。请注意,是排列的只是数量的对象,我们发现等于在“枚举的基因顺序”

给定:正整数,并这样和。

返回值:部分排列的总数,取1,000,000。

Sample Dataset

21 7

Sample Output

51200
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值