摘要: 题目链接:https://codeforces.com/problemset/problem/1093/E 解题思路来自 oi.wiki 这道题 与其说是 “分块 套 树状数组”,不如说是 “树状数组 套 分块 (再)套 树状数组”。因为分块还需要用树状数组维护一个前缀和。 如果直接 分块 + 树状 阅读全文
posted @ 2026-01-08 23:03 quanjun 阅读(9) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P2617 这题应该算模板题吧。 示例程序: #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5, inf = 1e9; int n, 阅读全文
posted @ 2026-01-08 19:30 quanjun 阅读(3) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P4093 解题思路完全来自 一剑霜寒十四洲 大佬的博客 大题思路是: 我们设3个数组: \(a[i]\) 表示原来第 \(i\) 个位置上的值。 \(maxa[i]\) 表示第 \(i\) 个位置上可以变成的最大值。 \( 阅读全文
posted @ 2026-01-08 18:36 quanjun 阅读(6) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P1903 特别鸣谢 感谢 CuteMurasame 大佬 帮我指出了 splay tree 的 get_rnk 函数忘了 splay 的问题。 我的思路大致是这样的(这一部分显示暴力维护一个 \(pre_i\)): 我们用 阅读全文
posted @ 2026-01-08 17:24 quanjun 阅读(10) 评论(0) 推荐(0)