結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー ygd.ygd.
提出日時 2021-11-21 12:39:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 570 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 77,284 KB
最終ジャッジ日時 2023-09-04 21:23:16
合計ジャッジ時間 6,024 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,592 KB
testcase_01 AC 75 ms
71,320 KB
testcase_02 AC 75 ms
71,344 KB
testcase_03 AC 77 ms
71,640 KB
testcase_04 AC 130 ms
76,676 KB
testcase_05 AC 73 ms
71,112 KB
testcase_06 AC 82 ms
76,680 KB
testcase_07 AC 81 ms
76,508 KB
testcase_08 AC 74 ms
71,272 KB
testcase_09 AC 77 ms
75,368 KB
testcase_10 AC 85 ms
76,616 KB
testcase_11 AC 86 ms
76,612 KB
testcase_12 AC 148 ms
77,188 KB
testcase_13 AC 83 ms
76,472 KB
testcase_14 AC 93 ms
76,288 KB
testcase_15 AC 101 ms
76,176 KB
testcase_16 AC 109 ms
76,328 KB
testcase_17 AC 134 ms
77,204 KB
testcase_18 AC 153 ms
77,284 KB
testcase_19 AC 148 ms
77,152 KB
testcase_20 AC 88 ms
76,544 KB
testcase_21 AC 88 ms
76,544 KB
testcase_22 AC 76 ms
71,428 KB
testcase_23 AC 79 ms
75,820 KB
testcase_24 AC 78 ms
75,560 KB
testcase_25 AC 90 ms
76,208 KB
testcase_26 AC 88 ms
76,364 KB
testcase_27 AC 86 ms
76,024 KB
testcase_28 AC 129 ms
76,564 KB
testcase_29 AC 125 ms
76,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline
#input = sys.stdin.buffer.readline


def main():
    N,M,T = map(int,input().split()); MOD = 998244353
    G =[[] for _ in range(N)]
    for i in range(M):
        a,b = map(int,input().split())
        G[a].append(b)
        G[b].append(a)
    
    dp = [0]*N
    dp[0] = 1
    for i in range(T):
        p = [0]*N
        p,dp = dp,p
        for v in range(N):
            for u in G[v]:
                dp[v] += p[u]
                dp[v] %= MOD
    ans = dp[0]%MOD
    print(ans)
        

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