摘要: 原题传送门 思路分析 线段树。 这道题让我们进行两种操作,分别是单点修改和区间查询,结合数据范围,很明显是一道线段树。 区间里最大的 \(A_i+A_j\),其实就是求区间里的最大值和次大值,我们用线段树维护最大值和次大值。 建树 void build(int now,int tl,int tr){ 阅读全文
posted @ 2024-09-06 21:19 shimingxin1007 阅读(4) 评论(0) 推荐(0) 编辑