$k$-Nim 游戏的经典结论是,先手必败当且仅当把每堆石子的个数二进制拆分后,每一位上 $1$ 的个数都是 $k+1$ 的倍数。因此问题就变成了 $7^7$ 长度的 $7$ 进制不进位加法卷积快速幂。模 $998244353$ 存在 $7$ 阶单位根,故直接 $7$ 进制 FWT 即可,时间复杂度 $O(7^d\cdot (7\cdot d+\log K))$,其中 $d=7$。
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 #190 for Problem #3088. Games
Type: Editorial
Status: Open
Posted by: jiangly
Posted at: 2025-12-13 00:01:08
Last updated: 2025-12-13 00:01:11
题解
Comments
No comments yet.