当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5211:Mutiple

题目描述
WLD likes playing with a sequence $a[1..N]$. One day he is playing with a sequence of $N$ integers. For every index i, WLD wants to find the smallest index $F(i)$ ( if exists ), that $i < F(i) \leq n$, and $a_F(i)$ mod $a_i$ = 0. If there is no such an index $F(i)$, we set $F(i)$ as 0.
输入解释
There are Multiple Cases.(At MOST $10$)

For each case:

The first line contains one integers $N (1 \leq N \leq 10000)$.

The second line contains $N$ integers $a1,a2,...,aN(1 \leq ai \leq 10000)$,denoting the sequence WLD plays with. You can assume that all ai is distinct.
输出解释
For each case:

Print one integer.It denotes the sum of all $F(i)$ for all $1 \leq i < n$
输入样例
4
1 3 2 4
输出样例
6

提示
F(1)=2
F(2)=0
F(3)=4
F(4)=0
来自杭电HDUOJ的附加信息
Recommend hujie

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5211

最后修改于 2020-10-25T23:20:44+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 65536/65536K(Java/Others)