摘要: 题目: 有 n 个元素,第 i 个元素有 ai 、bi 、ci 三个属性,设 f(i) 表示满足 aj ≤ ai 且 bj ≤ bi 且 cj ≤ ci 的 j 的数量。对于 d∈[0,n),求 f(i)=d 的 i 的数量。 题解: 可以对第一维a进行排序(O(nlogn)),然后对第二维进行归并 阅读全文
posted @ 2019-10-27 14:43 wuliking 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 简述: 解决线段树无法求区间第k大的问题 代码: 1 ///主席树模版(查询区间第k大) 2 #include <cstdio> 3 #include <cstdlib> 4 #include <cstring> 5 #include <algorithm> 6 #include <cctype> 阅读全文
posted @ 2019-10-27 00:19 wuliking 阅读(188) 评论(0) 推荐(0) 编辑