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

建议使用的浏览器:

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

2094:Angry Teacher

题目描述
Mr. O'Cruel is teaching Math to ninth grade students. Students of course are very lazy, so they do not like to do their homework. On the other side, Mr. O'Cruel doesn't like lazy students.
Recently Andrew failed to do his homework again, so he was given a special task. If he doesn't do it, he will be expelled from his school. The task seems very easy, but it is very technical, so it would take a lot of time. Andrew is given a polynomial p(x) = anxn + an-1xn-1 + . . . + a1x + a0 with integer coefficients.
He must calculate the value of the polynomial for k successive integer numbers starting from l. Of course writing all these numbers would require too much paper. So as a proof of completing the task, for each number x from l to l + k - 1 Andrew is asked to provide the sum of squares of m last digits in decimal notation of p(x).
Since Andrew is lazy, he doesn't want to do the task by himself. So he asks you to write the program that calculates the values requested.
输入解释
The first line of the input file contains n, l, k, and m (0 <= n <= 10, 0 <= l <= 101000 , 1 <= k <= 1 000, 1 <= m <= 1 000).
The following n + 1 lines contain coefficients of the polynomial: an , an-1 , . . . , a1 , a0 (0 <= ai <= 101000).
输出解释
Output k lines --- for x from l to l + k - 1 output the sum of squares of last m digits of p(x).
输入样例
3 0 10 2
1
0
2
1
输出样例
1
16
10
25
58
45
85
89
85
80
来自北京大学POJ的附加信息
Case time limit(单组数据时间限制) 2000MS

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2094

最后修改于 2020-10-29T06:23:14+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
10000 64000