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

建议使用的浏览器:

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

2527:Polynomial Remains

题目描述
Given the polynomial
a(x) = an xn + ... + a1 x + a0,

compute the remainder r(x) when a(x) is divided by xk+1.
输入解释
The input consists of a number of cases. The first line of each case specifies the two integers n and k (0 <= n, k <= 10000). The next n+1 integers give the coefficients of a(x), starting from a0 and ending with an. The input is terminated if n = k = -1.
输出解释
For each case, output the coefficients of the remainder on one line, starting from the constant coefficient r0. If the remainder is 0, print only the constant coefficient. Otherwise, print only the first d+1 coefficients for a remainder of degree d. Separate the coefficients by a single space.

You may assume that the coefficients of the remainder can be represented by 32-bit integers.
输入样例
5 2
6 3 3 2 0 1
5 2
0 0 3 2 0 1
4 1
1 4 1 1 1
6 3
2 3 -3 4 1 0 1
1 0
5 1
0 0
7
3 5
1 2 3 4
-1 -1
输出样例
3 2
-3 -1
-2
-1 2 -3
0
0
1 2 3 4

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

源链接: POJ-2527

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

共提交 0

通过率 --%
时间上限 内存上限
1000 65536