CF1061C.Multiplicity
普及/提高-
通过率:0%
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).
输入格式
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 ).
输出格式
Print exactly one integer — the number of good subsequences taken modulo 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.