用两个栈维护双端队列,查询时需要合并两个 DP 数组,使用单调队列即可。时间复杂度 $O(Q\cdot MOD)$。
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 #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.