随笔分类 -  树状数组

摘要:三维偏序(陌上花开) 题目背景 这是一道模板题 可以使用bitset,CDQ分治,K-DTree等方式解决。 题目描述 有 n 个元素,第 i 个元素有 ai​、bi​、ci​ 三个属性,设 f(i) 表示满足 aj​≤ai​ 且 bj​≤bi​ 且 cj​≤ci​ 的 j 的数量。 对于 d∈[0 阅读全文
posted @ 2019-07-19 10:21 1371767389 阅读(361) 评论(0) 推荐(0)
摘要:Split The Tree 题目描述 You are given a tree with n vertices, numbered from 1 to n. ith vertex has a value wiWe define the weight of a tree as the number 阅读全文
posted @ 2018-09-05 20:16 1371767389 阅读(384) 评论(0) 推荐(0)
摘要:Different Integers Given a sequence of integers a1, a2, ..., an and q pairs of integers (l1, r1), (l2, r2), ..., (lq, rq), find count(l1, r1), count(l 阅读全文
posted @ 2018-07-19 22:55 1371767389 阅读(855) 评论(0) 推荐(1)