CF1061C.Multiplicity
普及+/提高
通过率:0%
时间限制:3.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given an integer array a1,a2,…,an.
The array b is called to be a subsequence of a if it is possible to remove some elements from a to get b.
Array b1,b2,…,bk is called to be good if it is not empty and for every i (1≤i≤k) bi is divisible by i.
Find the number of good subsequences in a modulo 109+7.
Two subsequences are considered different if index sets of numbers included in them are different. That is, the values of the elements do not matter in the comparison of subsequences. In particular, the array a has exactly 2n−1 different subsequences (excluding an empty subsequence).
给你一个整数数组 a1,a2,…,an。
若可通过从 a 中删除若干元素得到数组 b,则称 b 是 a 的一个子序列。
若数组 b1,b2,…,bk 非空,且对每个 i(1≤i≤k)均有 bi 被 i 整除,则称其为“好”的子序列。
求 a 中“好”子序列的个数,结果对 109+7 取模。
当两个子序列所包含元素的下标集合不同时,认为它们是不同的子序列。换言之,在比较子序列时,元素的值无关紧要。特别地,数组 a 恰有 2n−1 个不同的子序列(不包括空子序列)。
输入格式
The first line contains an integer n (1≤n≤100000) — the length of the array a.
The next line contains integers a1,a2,…,an (1≤ai≤106).
第一行包含一个整数 n(1≤n≤100000)—— 数组 a 的长度。
第二行包含整数 a1,a2,…,an(1≤ai≤106)。
输出格式
Print exactly one integer — the number of good subsequences taken modulo 109+7.
输出一个整数——即“好”子序列的数量对 109+7 取模的结果。
输入输出样例
输入#1
2 1 2
输出#1
3
输入#2
5 2 2 1 22 14
输出#2
13
说明/提示
In the first example, all three non-empty possible subsequences are good: 1, 1,2, 2
In the second example, the possible good subsequences are: 2, 2,2, 2,22, 2,14, 2, 2,22, 2,14, 1, 1,22, 1,14, 22, 22,14, 14.
Note, that some subsequences are listed more than once, since they occur in the original array multiple times.
在第一个例子中,所有三个非空的可能子序列都是好的:1、1,2、2。
在第二个例子中,可能的好子序列有:2、2,2、2,22、2,14、2、2,22、2,14、1、1,22、1,14、22、22,14、14。
注意,某些子序列被多次列出,因为它们在原数组中多次出现。
输入解题思路,AI测评打分。不知道怎么写?