QOJ.ac

QOJ

Limite de temps : 5.0 s Limite de mémoire : 256 MB Points totaux : 100 Hackable ✓

#12217. 图计数

Statistiques

考虑具有 $2n$ 个顶点的无向图,且图中没有自环和重边。如果一个图 $G$ 不存在完美匹配,但对于任何不在 $G$ 中的边,将其加入 $G$ 后得到的图都存在完美匹配,则称该图 $G$ 是“好的”。

你的目标是计算 $2n$ 个顶点上不同的“好的”图的数量,结果对 $998\,244\,353$ 取模。

如果两个图不同构(即无法通过重标号顶点将一个图转换为另一个图),则认为它们是不同的。

输入格式

输入的第一行包含一个整数 $n$ ($1 \le n \le 500\,000$)。请注意,$2n$ 是图中顶点的数量。

输出格式

输出一个整数:$2n$ 个顶点上不同的“好的”图的数量,结果对 $998\,244\,353$ 取模。

样例

输入格式 1

2

输出格式 1

2

输入格式 2

353535

输出格式 2

331835697

说明

$2n = 4$ 时的图:

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#352EditorialOpen题解jiangly2025-12-14 07:15:21View

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.