QOJ.ac

QOJ

حد الوقت: 8 s حد الذاكرة: 512 MB مجموع النقاط: 100

#5469. 天に問わず

الإحصائيات

問題背景

而我不必独自 寻遍闲庭院 就遇见余生听琴的少年

問題説明

$n$ 個の頂点を持つ無向単純グラフ $G$ が与えられます。これを $k$ 個複製して、$kn$ 個の頂点と $km$ 本の辺を持つ無向グラフを得ます。その補グラフにおけるマッチングの総数を $f_k$ とします。ここで、マッチングは完全マッチングである必要はありません。

$k = 1, \dots, l$ のそれぞれについて、$f_k \pmod{998244353}$ を求めてください。

入力

1 行目に 2 つの正整数 $n, l$ が与えられます。

続く $n$ 行には $n \times n$ の 01 行列が与えられます。$G_{i,j} = G_{j,i}$ かつ $G_{i,i} = 0$ であることが保証されます。ここで $G_{i,j} = 1$ は頂点 $i$ と頂点 $j$ の間に辺が存在することを表します。

出力

$l$ 行出力してください。$k$ 行目には $f_k \pmod{998244353}$ を出力してください。

制約

すべてのデータにおいて、$1 \le l \le 3 \times 10^5$、$1 \le n \le 40$ を満たします。

合計 20 個のデータセットがあり、デカルト積の形式で生成されます。 $(n, l) \in \{20, 30, 36, 40\} \times \{1, 10^2, 10^4, 10^5, 3 \times 10^5\}$

対応する $(n_i, l_j)$ のデータセットは $a_i \cdot b_j$ の配点となります。ここで、$a = [4, 3, 2, 1], b = [3, 3, 2, 1, 1]$ です。

入出力例

入力 1

4 5
0 1 1 1
1 0 0 1
1 0 0 0
1 1 0 0

出力 1

3
321
58963
19412193
957504186

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
EditorialOpen Official EditorialQingyu- Download

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.