Universal Cup Judging System

Universal Cup

実行時間制限: 12 s メモリ制限: 1024 MB 満点: 100 難易度: [表示]
統計

題目描述

Kamome 正在努力訓練 AI 玩遊戲。她正在讓 AI 訓練「Senren Banka」這款遊戲。

這款遊戲每一輪包含 $n$ 個選擇分支。當且僅當你在同一輪中正確選擇了每一個分支時,才算通關遊戲。每一輪都從分支 $1$ 開始,對於每個 $i = 1, 2, \dots, n - 1$,只有在正確選擇第 $i$ 個分支之後,才能選擇第 $(i + 1)$ 個分支。如果做出了錯誤的選擇,就會進入 Bad Ending,並必須從頭重新開始——這被視為新的一輪遊戲。

Kamome 的 AI 可以從過去的選擇中學習。更具體地說,如果這是第 $j$ 次選擇第 $i$ 個分支,那麼 AI 有 $p_{i,\min(m,j)}$ 的機率選出正確選項。

Kamome 想知道這個 AI 首次通關遊戲所需的期望輪數。請輸出結果對 $998244353$ 取模。

輸入格式

第一行包含兩個整數 $n, m$($1 \le n \le 20$,$1 \le 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}$。

輸出格式

輸出一行包含一個整數,表示答案對 $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.