C(n,k) 的质因子分解 POJ - 2992

该问题要求确定组合数 C(n, k) 的质因数分解的因子数量。输入包含多组 n 和 k 的值(0 ≤ k ≤ n ≤ 431)。输出为每组 C(n, k) 的不同因子数量,不超过 2^63 - 1。解题策略包括打表和使用递推公式。递推公式涉及到在一定范围内将数按质因数分组并计算质因数幂次。" 102710624,8467487,matlab配置cvx与mosek求解器避坑指南,"['matlab', 'cvx', 'mosek', '凸优化', '软件配置']

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Your task in this problem is to determine the number of divisors of Cnk. Just for fun -- or do you need any special reason for such a useful computation?

Input

The input consists of several instances. Each instance consists of a single line containing two integers n and k (0 ≤ k ≤ n ≤ 431), separated by a single space.

Output

For each instance, output a line containing exactly one integer -- the number of distinct divisors of Cnk. For the input instances, this number does not exceed 2 63 - 1.

Sample Input

5 1
6 3
10 4

Sample Output

2
6
16

比赛的时候一直TLE,赛后发现数据太多需要打表……

打了个表很轻松就过了。

#include <cstdio>
#include <iostream>
#include <string.h>
#include <algorithm>
using namespace std;

bool g[500];
int m[500], y[500], a[500][500];      //a[i][j]表
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值