显然答案是关于 $K$ 的 $N-1$ 次多项式,DP 求出 $K=0,\ldots,N-1$ 的答案后插值即可,时间复杂度 $O(N^2)$。
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 #1528 for Problem #17719. The Symbolic Tree
Type: Editorial
Status: Open
Posted by: jiangly
Posted at: 2026-04-15 16:04:14
Last updated: 2026-04-15 16:04:17
题解
Comments
No comments yet.