問題一覧 > 通常問題

No.1749 Spread of the Lambdos Virus

レベル : / AI推定難易度 : 550 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 176
作問者 : ramdos / テスター : 👑 箱星
お気に入りにしたユーザー ProblemId : 7153 / 自分の提出
問題文最終更新日: 2021-11-19 21:04:15
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 323 (順位表) の他の問題:

Problem Statement

There are $N$ cities numbered $0,1,\ldots,N-1$ and $M$ roads. Road $i$ allows bidirectional travel between city $s_i$ and city $t_i$.

Each city has an infinite number of people.

On day $0$, the first case of the Lambdos virus, $1$ infected person, appeared in city $0$.

The number of people infected with the Lambdos virus in a given city on day $i$ is always the sum of the numbers of infected people on day $i-1$ over all cities directly connected to that city by a road.

Find the number of people infected with the Lambdos virus in city $0$ on day $T$, modulo 998244353.

Input

$N$ $M$ $T$
$s_0$ $t_0$
$s_1$ $t_1$
$\vdots$
$s_{M-1}$ $t_{M-1}$
  • $2 \leq N \leq 1 000$
  • $1 \leq M \leq \min\left(\dfrac{N(N-1)}{2} ,1 000\right)$
  • $1 \leq T \leq 1 000$
  • $0 \leq s_{i} \lt t_{i} \leq N-1$
  • All pairs $(s_i,t_i)$ are distinct
  • All input values are integers

Output

Output the answer as an integer.

Sample

Sample 1
Input
3 3 2
0 1
0 2
1 2
Output
2

The numbers of infected people are as shown in the table below.

CityDay 0Day 1Day 2
City 0102
City 1011
City 2011
Sample 2
Input
5 7 4
0 1
1 4
0 3
1 3
3 4
0 4
2 4
Output
22

The numbers of infected people are as shown in the table below.

CityDay 0Day 1Day 2Day 3Day 4
City 0103622
City 1012721
City 20012 8
City 3012721
City 4012822
Sample 3
Input
6 2 10
2 4
3 5
Output
0

The virus dies out instantly.

Sample 4
Input
3 2 100
0 1
0 2
Output
65980984

Note that you must find the answer modulo 998244353.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。