问题可以转化为在每个集合选择不超过一个数使得它们线性无关,并且总个数为 $n+m$。求一个划分拟阵和线性拟阵的交即可。注意连边的时候不能暴力检验删除 $y$ 加入 $x$ 后是否线性无关,而是找到异或出 $x$ 的数的集合,则 $x$ 能且仅能替换这个集合中的数(如果找不到这个集合,当然 $x$ 可以任意替换)。时间复杂度 $O((n+m)(n+m+\log C)\sum k_i)$。
QOJ.ac
QOJ
As we are currently experiencing an overwhelming number of web requests for fetching user submissions, we have temporarily disabled the full submissions list. You must now be logged in to view submissions.
Discussion #357 for Problem #12304. Pick Your Own Nim
Type: Editorial
Status: Open
Posted by: jiangly
Posted at: 2025-12-14 07:16:37
Last updated: 2025-12-14 07:16:42
题解
Comments
No comments yet.