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

建议使用的浏览器:

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

6593:Coefficient

题目描述
Given a function $f(x) = \frac{b}{c + e^{ax+d}}$, where $a \not \equiv 0 \pmod{998244353}$.

Denote $x_0$ as the smallest real solution of the equation: $ax+d=0$, and note that the solution always exists.

Output the coefficient of the item $(x-x_0)^n$ in the Taylor series of $f(x)$ at $x=x_0$. The answer may be very large, so you just need to output the answer modulo $998244353$.

Note that for the given $n$, your task is to answer $q$ queries which share the same parameter $n$.

Note that it is not guaranteed that the answer could be represented as rational fraction $\frac{p}{q}$ where $gcd(p,q)=1$, or $q$ has no multiplicative inverse element modulo $998244353$. If it can, print it as $pq^{-1}$ modulo $998244353$ which is not negative. Otherwise just print $-1$.

If you knew little about $gcd$ in mathematic, please refer to https://en.wikipedia.org/wiki/Greatest_common_divisor

If you knew little about $Taylor\_series$ in mathematic, please refer to https://en.wikipedia.org/wiki/Taylor_series
输入解释
There are multiple test cases.

Each case starts with a line containing two integers $n$ and $q$ seperated by a space.

Next $q$ lines in every test case will include four integers $a$, $b$, $c$, $d$ per line, seperated by $3$ spaces.

It is guaranteed that $\forall t \in \{a,b,c,d\},|t| \le 10^9$ and $n,q \in [0,5 \times 10^4]$.

It is guaranteed that the sum of $n$ and the sum of $q$ in all test cases are both no larger than $3 \times 10^5$.
输出解释
For each query in each test case, output the only line containing just one integer denoting the answer if there would be, or $-1$ otherwise.
输入样例
0 1
1 1 1 1
输出样例
499122177
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6593

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

共提交 0

通过率 --%
时间上限 内存上限
28000/14000MS(Java/Others) 262144/262144K(Java/Others)