QOJ.ac

QOJ

حد الوقت: 6 s حد الذاكرة: 64 MB مجموع النقاط: 130

#13592. Mobitel

الإحصائيات

小 Nikola 最近学习了乘法表。为了继续学习,他想出了以下任务。

他制作了一个大小为 $R \times S$ 的表格。在表格的每个格子中,他写了一个整数,并问自己:从表格的左上角出发,每次向右或向下移动一格,到达右下角,有多少种可能的路径,使得路径上所有数字(包括起点和终点格子)的乘积至少为 $N$?

由于他现在没有时间,他向你寻求帮助。由于所需的路径数可能非常大,请输出其模 $10^9 + 7$ 的余数。

输入格式

第一行包含整数 $R, S$($1 \le R, S \le 300$)和 $N$($1 \le N \le 10^6$)。

接下来的 $R$ 行,每行包含 $S$ 个介于 $1$ 和 $10^6$ 之间的整数,表示表格中每个格子里的数字。

输出格式

在唯一的一行中,输出满足条件的路径数模 $10^9 + 7$ 的余数。

子任务

  • 在占总分 20% 的测试数据中,满足 $N \le 300$。
  • 在占总分 20% 的测试数据中,满足 $R, S \le 100$,且表格中的所有数字均小于或等于 10。
  • 在另占总分 30% 的测试数据中,满足 $R, S \le 100$。

样例

输入格式 1

2 3 200
2 3 4
5 6 7

输出格式 1

2

输入格式 2

3 3 90
2 1 1
45 1 1
1 1 1

输出格式 2

3

输入格式 3

2 5 3000
1 2 3 4 5
6 7 8 9 10

输出格式 3

3

说明

样例 1 说明:

共有三种可能的路径:

  • 2 -> 3 -> 4 -> 7 - 总乘积为 168
  • 2 -> 3 -> 6 -> 7 - 总乘积为 252
  • 2 -> 5 -> 6 -> 7 - 总乘积为 420

由于 $N = 200$,只有后两条路径的乘积至少为 200,因此输出为 2。

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#830EditorialOpen简要题解alpha10222026-01-28 02:10:32View

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.