Universal Cup Judging System

Universal Cup

时间限制: 12 s 内存限制: 1024 MB 总分: 100 难度: [显示]
统计

KamomeはゲームをプレイするAIを訓練しようとしている。そのAIに「Senren Banka」というゲームを訓練させる。

このゲームは各ターンに$n$本の選択枝がある。各枝を1ターンで正しく選択した場合にのみ、ゲームをクリアしたとみなされる。各ターンは枝1から始まり、$i = 1, 2, \dots, n-1$について、枝$i$を正しく選択した後にのみ枝$i+1$を選択できる。誤った選択をすると「バッドエンド」になり、最初からやり直すことになる。これはゲームの新しいターンとみなされる。

カモメのAIは過去の選択から学習できる。具体的には、AIが$i$番目の枝を選択するのが$j$回目である場合、AIが正しい選択をする確率は$P_{i,j}$である。

カモメはこのAIが初めてゲームをクリアするまでのターン数の期待値を知りたい。結果をmod 998244353で出力せよ。

入力

最初の行には2つの整数$n, m$ ($1 \le n \le 20$, $1 < m \le 5 \times 10^4$)が含まれ、選択枝の数とこのAIの閾値を示す。

続く$n$行には、各行に$m$個の整数$p_{i,j}$ ($1 \le p_{i,j} \le 100$)が含まれ、$P_{i,j} = \frac{p_{i,j}}{100}$を示す。

出力

答えをmod 998244353で出力せよ。

入出力例

入力 1

1 1
50

出力 1

2

入力 2

2 2
25 50
50 25

出力 2

499122183

入力 3

10 10
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 100

出力 3

473598335

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.