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

建议使用的浏览器:

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

5307:He is Flying

题目描述
JRY wants to drag racing along a long road. There are $n$ sections on the road, the $i$-th section has a non-negative integer length $s_i$. JRY will choose some continuous sections to race (at an unbelievable speed), so there are totally $\frac{n(n+1)}{2}$ different ways for him to ride. If JRY rides across from the $i$-th section to the $j$-th section, he would gain $j-i+1$ pleasure. Now JRY wants to know, if he tries all the ways whose length is $s$, what's the total pleasure he can get. Please be aware that in the problem, the length of one section could be zero, which means that the length is so trivial that we can regard it as $0$.
输入解释
The first line of the input is a single integer $T\ (T=5)$, indicating the number of testcases.

For each testcase, the first line contains one integer $n$. The second line contains $n$ non-negative integers, which mean the length of every section. If we denote the total length of all the sections as $s$, we can guarantee that $0 \le s \le 50000$ and $1 \le n \le 100000$.
输出解释
For each testcase, print $s+1$ lines. The single number in the $i$-th line indicates the total pleasure JRY can get if he races all the ways of length $i-1$.
输入样例
2
3
1 2 3
4
0 1 2 3
输出样例
0
1
1
3
0
2
3
1
3
1
6
0
2
7
来自杭电HDUOJ的附加信息
Author XJZX
Recommend wange2014

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

源链接: HDU-5307

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

共提交 0

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