kZjPBD.jpg

随笔分类 -  树形结构——线段树 / BIT

摘要:C - Rooks Defenders 线段树模板,维护:1)v:个数 , 2)sum:v的个数是否大于0. // #include"bits/stdc++.h" #include"iostream" using namespace std; const int N = 2e5; struct No 阅读全文
posted @ 2024-02-25 22:27 Through_The_Night 阅读(3) 评论(0) 推荐(0) 编辑
摘要:There are nn pirate chests buried in Byteland, labeled by 1,2,…,n1,2,…,n. The ii-th chest's location is (xi,yi)(xi,yi), and its value is wiwi, wiwi ca 阅读全文
posted @ 2019-08-21 09:38 Through_The_Night 阅读(234) 评论(0) 推荐(0) 编辑
摘要:You have an array: a1, a2, , an and you must answer for some queries. For each query, you are given an interval [L, R] and two numbers p and K. Your 阅读全文
posted @ 2019-08-13 20:27 Through_The_Night 阅读(180) 评论(0) 推荐(0) 编辑
摘要:题目描述 给出一个长度为 的数列 和一个长度为 的数列 ,求 有多少个长度为 的连续子数列能与 匹配。 两个数列可以匹配,当且仅当存在一种方案,使两个数列中的数可以两两配对,两个数可以配对当且仅当它们的和不小于 。 题目描述 给出一个长度为 的数列 和一个长度为 的数列 ,求 有多少个长度为 的连续 阅读全文
posted @ 2019-07-30 16:17 Through_The_Night 阅读(311) 评论(0) 推荐(0) 编辑
摘要:Song Zha Zha has an 11-indexed array A . Li Zha Zha has QQ queries . Each query has two integers LL, RR , asking Ran Zha Zha to do the following thing 阅读全文
posted @ 2019-07-30 14:56 Through_The_Night 阅读(652) 评论(0) 推荐(0) 编辑
摘要:题目大意:中文题目 具体思路:通过两棵线段树来维护,第一棵线段树来维护当前坐标的点的日增长速度(默认每一年的增长速度都是当前年份的增长速度),对于第一棵线段树,肯定会存在多算的情况,那么我们第二棵线段树就维护每一个点的多算的情况就可以了。 举个例子:当前的n只有1,初始值也是1, 三个操作,第一年加 阅读全文
posted @ 2019-07-25 19:04 Through_The_Night 阅读(219) 评论(0) 推荐(0) 编辑
摘要:Shinku is very interested in the set. One day, she got nnn sets, and the iii-th number aia_iai​ is in the iii-th set. But she doesn't think it is inte 阅读全文
posted @ 2019-07-07 22:03 Through_The_Night 阅读(309) 评论(0) 推荐(0) 编辑
摘要:题目描述 设 T 为一棵有根树,我们做如下的定义: • 设 a 和 b 为 T 中的两个不同节点。如果 a 是 b 的祖先,那么称“a 比 b 不知道高明到哪里去了”。 • 设 a 和 b 为 T 中的两个不同节点。如果 a 与 b 在树上的距离不超过某个给定常数 x,那么称“a 与 b 谈笑风生” 阅读全文
posted @ 2019-06-14 18:56 Through_The_Night 阅读(321) 评论(0) 推荐(0) 编辑
摘要:Sorting 尚未提交 尚未通过 时间限制:1000ms 内存限制:256MB 0.00% 提交人数:3 通过人数:0 Sorting 尚未提交 尚未通过 时间限制:1000ms 内存限制:256MB Sorting 尚未提交 尚未通过 时间限制:1000ms 内存限制:256MB 0.00% 提 阅读全文
posted @ 2019-06-01 11:34 Through_The_Night 阅读(375) 评论(0) 推荐(0) 编辑
摘要:题目描述 九条可怜收到了一块神奇的画板。 画板被划分成了 nn 行 mm 列一共 n \times mn×m 个格子,记第 ii 行第 jj 列的格子的坐标为 (i,j)(i,j)。画板的每一行有属性 l_i,r_i(1 \leq l_i \leq r_i \leq m)li​,ri​(1≤li​≤ 阅读全文
posted @ 2019-05-22 17:49 Through_The_Night 阅读(241) 评论(0) 推荐(0) 编辑
摘要:Buber is a Berland technology company that specializes in waste of investor's money. Recently Buber decided to transfer its infrastructure to a cloud. 阅读全文
posted @ 2019-04-17 20:35 Through_The_Night 阅读(399) 评论(0) 推荐(1) 编辑
摘要:题目背景 深绘里一直很讨厌雨天。 灼热的天气穿透了前半个夏天,后来一场大雨和随之而来的洪水,浇灭了一切。 虽然深绘里家乡的小村落对洪水有着顽固的抵抗力,但也倒了几座老房子,几棵老树被连根拔起,以及田地里的粮食被弄得一片狼藉。 无奈的深绘里和村民们只好等待救济粮来维生。 不过救济粮的发放方式很特别。 阅读全文
posted @ 2019-03-25 19:53 Through_The_Night 阅读(142) 评论(0) 推荐(0) 编辑
摘要:题目描述 lxhgww最近收到了一个01序列,序列里面包含了n个数,这些数要么是0,要么是1,现在对于这个序列有五种变换操作和询问操作: 0 a b 把[a, b]区间内的所有数全变成0 1 a b 把[a, b]区间内的所有数全变成1 2 a b 把[a,b]区间内的所有数全部取反,也就是说把所有 阅读全文
posted @ 2019-03-14 21:41 Through_The_Night 阅读(157) 评论(0) 推荐(0) 编辑
摘要:F. Monkeying Around time limit per test 2.0 s memory limit per test 256 MB input standard input output standard output When the monkey professor leave 阅读全文
posted @ 2019-03-13 19:15 Through_The_Night 阅读(308) 评论(0) 推荐(0) 编辑
摘要:以m的总价在线段树中找能雇佣的最大人数,然后向上合并 阅读全文
posted @ 2019-02-03 00:06 Through_The_Night 阅读(172) 评论(0) 推荐(0) 编辑
摘要:题目描述 Bytetown城市要进行市长竞选,所有的选民可以畅所欲言地对竞选市长的候选人发表言论。为了统一管理,城市委员会为选民准备了一个张贴海报的electoral墙。 张贴规则如下: electoral墙是一个长度为N个单位的长方形,每个单位记为一个格子; 所有张贴的海报的高度必须与electo 阅读全文
posted @ 2019-01-29 15:36 Through_The_Night 阅读(227) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示