摘要: Buy Tickets 线段树 / 树状数组上二分 + 逆向思维 SCUACM2022集训前训练-数据结构 - Virtual Judge (vjudge.net) 、 题意 一开始每个位置都没有人,每次给出一个 \(pos\) 和 \(val\), 把 val 查到第 pos + 1 的位置,求最 阅读全文
posted @ 2022-05-24 21:58 hzy0227 阅读(26) 评论(0) 推荐(0) 编辑
摘要: Apple Tree SCUACM2022集训前训练-数据结构 - Virtual Judge (vjudge.net) dfs序 + 树状数组 注意以后存边时写,效率较高 vector<vector<int> > G(N); #include <iostream> #include <cstrin 阅读全文
posted @ 2022-05-24 20:43 hzy0227 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 线段树 区间加 ,区间和,区间最值,区间推平 #include <iostream> #include <cstring> #include <algorithm> #include <vector> #include <cmath> #include <cstdio> using namespac 阅读全文
posted @ 2022-05-24 20:02 hzy0227 阅读(21) 评论(0) 推荐(0) 编辑