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

建议使用的浏览器:

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

6036:Division Game

题目描述
There are $k$ piles of stones in a circle, numbered from $0$ to $k - 1$, where the number of the stones in each pile is $n$ initially. You can do some round operations, where the initial round is numbered as the $1$-st round.

The operation of the $i$-th round is to modify the pile of stones numbered $(i - 1) \bmod k$. In each round, you should remove from this pile some stones (at least one stone), satisfying that the number of stones in this pile before this operation is a multiple of the number of stones in this pile after operation, which means that you ought to remain at least one stone in this pile.

The game is ended if there exists at least one pile containing only one stone. Given two positive integers $n$ and $k$, your task is to calculate for each pile the number of the possible operation plans that it is the last operated pile before the game is ended.

The integer $n$ may be very large, so the prime-factor decomposition of $n$ will be given, in other words, if $n = \prod_{i = 1}^{m}{p_i^{e_i}}$, then the integers $m$ and $(p_i, e_i)$ $(1 \leq i \leq m)$ will be given, but the integer $n$ will not.

The answer may be very large, so you only need to give the value of the answer modulo $985661441$.
输入解释
The input contains multiple test cases.

For each test case:

The first line contains two positive integers $m$ and $k$, satisfying that $1 \leq m, k \leq 10$.

In next $m$ lines, the $i$-th line contains two positive integers $p_i$ and $e_i$, satisfying that $2 \leq p_i \leq 10^9,$ $e_i \geq 1,$ $\sum_{i = 1}^{m}{e_i} \leq 10^5$.

It is guaranteed that $p_1, p_2, \cdots, p_m$ are distinct.

About $200$ test cases in total, where no more than $5$ cases satisfy $\sum_{i = 1}^{m}{e_i} \geq 10^4$.
输出解释
For each test case, output "Case #$x$: $y_0$ $y_1$ $\cdots$ $y_{k - 1}$" in one line (without quotes), where $x$ indicates the case number starting from $1$ and $y_i$ $(0 \leq i < k)$ denotes the number of the possible operation plans modulo $985661441$ for the pile numbered $i$ of corresponding case.
输入样例
1 1
2 2
2 1
3 1
5 1
1 2
2 3
2 2
2 4
5 4
输出样例
Case #1: 2
Case #2: 3
Case #3: 6 4
Case #4: 1499980 1281085
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6036

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

共提交 0

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