結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー 👑 tamatotamato
提出日時 2021-11-19 21:32:41
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 492 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 87,324 KB
実行使用メモリ 76,580 KB
最終ジャッジ日時 2023-08-30 07:31:34
合計ジャッジ時間 4,130 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,620 KB
testcase_01 AC 70 ms
71,676 KB
testcase_02 AC 70 ms
71,536 KB
testcase_03 AC 71 ms
71,808 KB
testcase_04 AC 95 ms
76,144 KB
testcase_05 AC 69 ms
71,416 KB
testcase_06 AC 71 ms
71,624 KB
testcase_07 AC 72 ms
71,736 KB
testcase_08 AC 70 ms
71,416 KB
testcase_09 AC 68 ms
71,680 KB
testcase_10 AC 71 ms
71,464 KB
testcase_11 AC 71 ms
71,412 KB
testcase_12 AC 98 ms
76,568 KB
testcase_13 AC 77 ms
76,196 KB
testcase_14 AC 77 ms
76,208 KB
testcase_15 AC 80 ms
76,232 KB
testcase_16 AC 84 ms
76,440 KB
testcase_17 AC 96 ms
76,372 KB
testcase_18 AC 103 ms
76,568 KB
testcase_19 AC 97 ms
76,580 KB
testcase_20 AC 79 ms
76,004 KB
testcase_21 AC 77 ms
75,948 KB
testcase_22 AC 71 ms
71,532 KB
testcase_23 AC 70 ms
71,620 KB
testcase_24 AC 74 ms
75,752 KB
testcase_25 AC 77 ms
75,892 KB
testcase_26 AC 78 ms
75,820 KB
testcase_27 AC 76 ms
75,868 KB
testcase_28 AC 95 ms
76,444 KB
testcase_29 AC 96 ms
76,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 998244353
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N, M, T = map(int, input().split())
    E = []
    for _ in range(M):
        E.append(tuple(map(int, input().split())))

    dp = [[0] * N for _ in range(T+1)]
    dp[0][0] = 1
    for t in range(1, T+1):
        for u, v in E:
            dp[t][u] = (dp[t][u] + dp[t - 1][v])%mod
            dp[t][v] = (dp[t][v] + dp[t - 1][u]) % mod
    print(dp[-1][0])


if __name__ == '__main__':
    main()
0