用两个栈维护双端队列,查询时需要合并两个 DP 数组,使用单调队列即可。时间复杂度 $O(Q\cdot MOD)$。
QOJ.ac
QOJ
Discussion #300 for Problem #11624. Knapsack and Queries
Type: Editorial
Status: Open
Posted by: jiangly
Posted at: 2025-12-14 06:57:08
Last updated: 2025-12-14 06:57:22
题解
Comments
No comments yet.