线段树 树状数组
萧瑟1
这个作者很懒,什么都没留下…
展开
-
Leetcode 315. 计算右侧小于当前元素的个数 线段树
给定一个整数数组 nums,按要求返回一个新数组 counts。数组 counts 有该性质: counts[i] 的值是 nums[i] 右侧小于 nums[i] 的元素的数量。 示例: 输入: [5,2,6,1] 输出: [2,1,1,0] 解释: 5 的右侧有 2 个更小的元素 (2 和 1). 2 的右侧仅有 1 个更小的元素 (1). 6 的右侧有 1 个更小的元素 (1). ...原创 2018-09-05 21:43:24 · 751 阅读 · 0 评论 -
ACM-ICPC 2018 徐州赛区网络预赛 徐州 H Ryuji doesn't want to study 线段树
Ryuji is not a good student, and he doesn't want to study. But there are n books he should learn, each book has its knowledge a[i]a[i]a[i]. Unfortunately, the longer he learns, the fewer he gets. Th...原创 2018-09-10 14:19:34 · 311 阅读 · 0 评论 -
POJ - 2528 Mayor's posters 线段树+特殊离散化+区间更新
题目: The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has fina...原创 2019-03-16 10:26:24 · 174 阅读 · 0 评论 -
HDU - 1698 Just a Hook 线段树+区间更新
题目: In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length. Now...原创 2019-03-16 11:34:48 · 153 阅读 · 0 评论 -
ZOJ - 1610 Count the Colors 线段树+区间更新
题目: Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones. Your task is counting the segments of different colors you can see at last....原创 2019-03-16 15:02:13 · 153 阅读 · 0 评论 -
POJ - 3264 Balanced Lineup 线段树
题目: 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 game of Ultimate Frisbee with some of the cows. To keep th...原创 2019-03-16 15:55:35 · 141 阅读 · 0 评论 -
HDU - 4027 Can you answer these queries? 线段树
题目: A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Each of the battleships can be marked a value o...原创 2019-03-16 19:19:33 · 156 阅读 · 0 评论 -
HDU - 1540 Tunnel Warfare 线段树+最值更新
题目: During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected by tunnels lay in a line. Exc...原创 2019-03-17 10:11:56 · 137 阅读 · 0 评论 -
HDU - 3974 Assign the task dfs确定区间+线段树
题目: There is a company that has N employees(numbered from 1 to N),every employee in the company has a immediate boss (except for the leader of whole company).If you are the immediate boss of someone,...原创 2019-03-17 14:47:19 · 153 阅读 · 0 评论