結果
問題 | No.1749 ラムドスウイルスの感染拡大 |
ユーザー |
![]() |
提出日時 | 2025-03-20 18:42:25 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 112 ms / 2,000 ms |
コード長 | 505 bytes |
コンパイル時間 | 170 ms |
コンパイル使用メモリ | 82,512 KB |
実行使用メモリ | 76,640 KB |
最終ジャッジ日時 | 2025-03-20 18:42:40 |
合計ジャッジ時間 | 2,756 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
n, m, t = map(int, input().split()) mod = 998244353 adj = [[] for _ in range(n)] for _ in range(m): s, t_i = map(int, input().split()) adj[s].append(t_i) adj[t_i].append(s) prev = [0] * n prev[0] = 1 # Initial state on day 0 for _ in range(t): curr = [0] * n for u in range(n): total = 0 for v in adj[u]: total += prev[v] if total >= mod: total -= mod curr[u] = total % mod prev = curr.copy() print(prev[0] % mod)