Processing math: 100%

随笔分类 -  线段树

摘要:Description For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a g 阅读全文
posted @ 2019-01-05 21:18 TobicYAL 阅读(272) 评论(0) 推荐(0) 编辑
摘要:每个非叶结点所表示的结点[a,b],左儿子表示区间[a,a+b2],右儿子表示的区间为[a+b2+1,b] 叶子结点表示区间长度为1 数据结构 用一维数组存放线段树(idx)时,数组开到4n大可以确保不越界。 操作 区间分解 从根节点开始递归进行区间分 阅读全文
posted @ 2018-12-30 15:14 TobicYAL 阅读(472) 评论(0) 推荐(0) 编辑
摘要:描述 A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. 阅读全文
posted @ 2018-10-22 20:19 TobicYAL 阅读(319) 评论(1) 推荐(0) 编辑
摘要:描述 You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a 阅读全文
posted @ 2018-10-22 20:10 TobicYAL 阅读(285) 评论(0) 推荐(0) 编辑
摘要:题目描述 如题,已知一个数列,你需要进行下面两种操作: 1.将某区间每一个数加上x 2.求出某区间每一个数的和 输入输出格式 输入格式: 第一行包含两个整数N、M,分别表示该数列数字的个数和操作的总个数。 第二行包含N个用空格分隔的整数,其中第i个数字表示数列第i项的初始值。 接下来M行每行包含3或 阅读全文
posted @ 2018-10-16 17:06 TobicYAL 阅读(202) 评论(0) 推荐(0) 编辑
摘要:描述 The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all 阅读全文
posted @ 2018-10-16 10:15 TobicYAL 阅读(257) 评论(0) 推荐(0) 编辑
摘要:描述 N (2 <= N <= 8,000) cows have unique brands in the range 1..N. In a spectacular display of poor judgment, they visited the neighborhood 'watering h 阅读全文
posted @ 2018-10-15 22:17 TobicYAL 阅读(305) 评论(0) 推荐(0) 编辑

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