CF396A.On Number of Decompositions into Multipliers
普及/提高-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given an integer m as a product of integers _a_1, _a_2, ... a__n
. Your task is to find the number of distinct decompositions of number m into the product of n ordered positive integers.
Decomposition into n products, given in the input, must also be considered in the answer. As the answer can be very large, print it modulo 1000000007 (109 + 7).
给定一个整数 $ m $,它是整数 $ a_1,,a_2,,\dots,,a_n $ 的乘积:
。你的任务是求出将整数 $ m $ 分解为 $ n $ 个有序正整数之积的不同方案数。
输入中给出的这组 $ n $ 个因子的分解也必须计入答案。由于答案可能非常大,请输出其对 $ 1000000007 $(即 $ 10^9 + 7 $)取模的结果。
输入格式
The first line contains positive integer n (1 ≤ n ≤ 500). The second line contains space-separated integers _a_1, _a_2, ..., a__n (1 ≤ a__i ≤ 109).
第一行包含一个正整数 n(1≤n≤500)。第二行包含 n 个用空格分隔的整数 a1, a2, …, an(1≤ai≤109)。
输出格式
In a single line print a single number k — the number of distinct decompositions of number m into n ordered multipliers modulo 1000000007 (109 + 7).
在一行中输出一个整数 k —— 将整数 m 分解为 n 个有序因子的不同分解方式的数目,对 1000000007(即 109+7)取模。
输入输出样例
输入#1
1 15
输出#1
1
输入#2
3 1 1 2
输出#2
3
输入#3
2 5 7
输出#3
4
说明/提示
In the second sample, the get a decomposition of number 2, you need any one number out of three to equal 2, and the rest to equal 1.
In the third sample, the possible ways of decomposing into ordered multipliers are [7,5], [5,7], [1,35], [35,1].
A decomposition of positive integer m into n ordered multipliers is a cortege of positive integers b = {_b_1, _b_2, ... b__n} such that
. Two decompositions b and c are considered different, if there exists index i such that b__i ≠ c__i.
在第二个样例中,要得到数字 2 的一种分解,需要三个数中恰好有一个等于 2,其余两个均等于 1。
在第三个样例中,将该数分解为有序因子的所有可能方式为:[7,5]、[5,7]、[1,35]、[35,1]。
正整数 m 分解为 n 个有序因子,是指一个正整数序列 b={b1,b2,…,bn},满足
。
若存在某个下标 i 使得 bi=ci,则称两种分解 b 和 c 是不同的。
输入解题思路,AI测评打分。不知道怎么写?