AZ. [NOI2013] 矩阵游戏
[NOI2013] 矩阵游戏
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
婷婷是个喜欢矩阵的小朋友,有一天她想用电脑生成一个巨大的 行 列的矩阵(你不用担心她如何存储)。她生成的这个矩阵满足一个神奇的性质:若用 来表示矩阵中第 行第 列的元素,则 满足下面的递推式:
$$\begin{aligned} F[1, 1] &= 1 \\ F[i, j] &=a\times F[i, j-1]+b, &j\neq 1 \\ F[i, 1] &=c\times F[i-1, m]+d, &i\neq 1 \\ \end{aligned}$$递推式中 都是给定的常数。
现在婷婷想知道 的值是多少,请你帮助她。由于最终结果可能很大,你只需要输出 除以 的余数。
输入格式
包含一行有六个整数 。意义如题所述。
输出格式
包含一个整数,表示 除以 的余数。
3 4 1 3 2 6
85
提示
【样例1说明】
样例中的矩阵为:
$$\begin{pmatrix} 1 & 4 & 7 & 10 \\ 26 & 29 & 32 & 35 \\ 76 & 79 & 82 & 85 \\ \end{pmatrix}$$数据范围
| 测试点编号 | 数据范围 |
|---|---|
| 1 | ; |
| 2 | ; |
| 3 | ; |
| 4 | |
| 5 | ;; |
| 6 | ;; |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | ;; |
| 12 | ;; |
| 13 | ; |
| 14 | |
| 15 | ; |
| 16 | |
| 17 | ;; |
| 18 | ;; |
| 19 | ; |
| 20 |
【A班】数学问题S
- Status
- Done
- Problem
- 62
- Open Since
- 2025-10-22 0:00
- Deadline
- 2025-11-28 23:59
- Extension
- 24 hour(s)