結果

問題 No.1749 ラムドスウイルスの感染拡大
コンテスト
ユーザー yassu0320
提出日時 2021-11-23 13:37:10
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 1,200 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 250 ms
コンパイル使用メモリ 85,428 KB
実行使用メモリ 86,812 KB
最終ジャッジ日時 2026-03-11 18:51:48
合計ジャッジ時間 3,367 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/env python3

from pprint import pprint
from sys import setrecursionlimit, stdin
from typing import Dict, Iterable, Set

INF: int = 1 << 62
MOD1000000007 = 10**9 + 7
MOD998244353 = 998244353
setrecursionlimit(1_000_000)


def inputs(type_=int):
    ins = input().split()

    if isinstance(type_, Iterable):
        return [t(x) for t, x in zip(type_, ins)]
    else:
        return list(map(type_, ins))


def input_(type_=int):
    a, = inputs(type_)
    return a


def input1() -> int:
    return int(input())


inputi = input1


def input2():
    a, b = input().split()
    return int(a), int(b)


def input3():
    a, b, c = input().split()
    return int(a), int(b), int(c)


def input4():
    a, b, c, d = input().split()
    return int(a), int(b), int(c), int(d)


def answer(res) -> None:
    print(res)
    exit()


# start coding

n, m, t = input3()
mod = MOD998244353
g = [[] for _ in range(n)]
for _ in range(m):
    p, q = input2()
    g[p].append(q)
    g[q].append(p)

cnts = [0] * n
cnts[0] = 1
for _ in range(t):
    ncnts = [0] * n
    for u in range(n):
        for v in g[u]:
            ncnts[v] += cnts[u]
            ncnts[v] %= mod
    cnts = ncnts

print(cnts[0])
0