容斥一下变成每一段长度都 $< K$ 的概率。DP,设 $f(i)$ 表示前 $i$ 个人每一段长度都 $< K$ 且第 $i$ 个人失败的概率,转移可以用前缀和维护,时间复杂度 $O(N+\log P)$,其中 $O(\log P)$ 来源于求逆元。
QOJ.ac
QOJ
The 3rd Universal Cup Finals is coming! Join our Warm-up Game and Prediction Game and win the prizes! Learn more...
Discussion #1522 for Problem #17713. Kendama Challenge
Type: Editorial
Status: Open
Posted by: jiangly
Posted at: 2026-04-15 16:02:51
Last updated: 2026-04-15 16:02:56
题解
Comments
No comments yet.