QOJ.ac

QOJ

Type: Editorial

Status: Open

Posted by: jiangly

Posted at: 2025-12-14 06:57:08

Last updated: 2025-12-14 06:57:22

Back to Problem

题解

用两个栈维护双端队列,查询时需要合并两个 DP 数组,使用单调队列即可。时间复杂度 $O(Q\cdot MOD)$。

Comments

No comments yet.