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

建议使用的浏览器:

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

3610:Maclaurin Series of Reciprocals

题目描述

Any function f(x) that is infinitely differentiable in the neighborhood of the point x = 0 can be expanded into a Maclaurin series

__poj_jax_start__f(0)+\frac{f'(0)}{1!}x+\frac{f''(0)}{2!}x^2+\frac{f^{(3)}(0)}{3!}x^3+\cdots__poj_jax_end__f(0)+\frac{f'(0)}{1!}x+\frac{f''(0)}{2!}x^2+\frac{f^{(3)}(0)}{3!}x^3+\cdots,

or more compactly,

__poj_jax_start__\sum_{k=0}^{\infty}\frac{f^{(k)}(0)}{k!}x^k__poj_jax_end__\sum_{k=0}^{\infty}\frac{f^{(k)}(0)}{k!}x^k.

Under certain conditions, f(x) is equal to its Maclaurin series for all x sufficiently close to 0.

Often, the Maclaurin series of f(x) is written up to only order xn-1 with a Peano remainder term, i.e., 

__poj_jax_start__\sum_{k=0}^{n-1}\frac{f^{(k)}(0)}{k!}x^k+\mathcal{O}(x^n)__poj_jax_end__\sum_{k=0}^{n-1}\frac{f^{(k)}(0)}{k!}x^k+\mathcal{O}(x^n),

which facilitates the evaluation of f(x). The series being truncated to the xn-1 term, details about higher-order terms are inevitably lost. However, certain information concerning the series remains well-preserved. For instance, the Maclaurin series of 1/f(x) with an identical Peano remainder term can still be found.

Given the Maclaurin series of a function f(x) with a Peano remainder term, determine that of the reciprocal of f(x).

输入解释

The input consists of a single test case.

The first line contains an integer n (1 ≤ n ≤ 100). Each of the next n lines contains a fraction pk/qk (0 ≤ k ≤ n - 1) where pk and qk (-100 ≤ pk ≤ 100, 1 ≤ qk ≤ 100) are integers coprime to each other in the form either pk/qk (if qk ≠ 1) or pk (if qk = 1). It is guaranteed that p0 ≠ 0.

The given numbers represent the Maclaurin series

__poj_jax_start__\sum_{k=0}^{n-1}\frac{p_k}{q_k}x^k+\mathcal{O}(x^n)__poj_jax_end__\sum_{k=0}^{n-1}\frac{p_k}{q_k}x^k+\mathcal{O}(x^n)

of some function f(x).

输出解释

Let the Maclaurin series of 1/f(x) be

__poj_jax_start__\sum_{k=0}^{n-1}\frac{p'_k}{q'_k}x^k+\mathcal{O}(x^n)__poj_jax_end__\sum_{k=0}^{n-1}\frac{p'_k}{q'_k}x^k+\mathcal{O}(x^n)

where qk' > 0, and pk' and qk' are integers coprime to each other. Output n lines each of the form either pk'/qk' (if qk' ≠ 1) or pk' (if qk' = 1), listing the coefficients of 1, x, x2, ... , xn-1 in order.

输入样例
10
1/2
-46/3
9/40
61/80
-22/5
-87/41
1/11
-42/5
-4/13
-21/44
输出样例
2
184/3
169199/90
6223213/108
28611844561/16200
107867589093163/1992600
545525329585163771/328779000
401297234058997162673/7890696000
2398505849871035056778279/1538685720000
882189800570641237196128639/18464228640000
来自北京大学POJ的附加信息
Case time limit(单组数据时间限制) 2000MS

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

源链接: POJ-3610

最后修改于 2020-10-29T07:06:04+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
5000 131072