数据结构-线段树
文章平均质量分 83
zhangjinlei321
这个作者很懒,什么都没留下…
展开
-
线段树原理
本文来源于大佬的讲解: 1:线段树从0开始:https://blog.csdn.net/zearot/article/details/52280189 2:详解:https://www.cnblogs.com/AC-King/p/7789013.html(包含扫描线,可持久化(主席树)) 综述 假设有编号从1到n的n个点,每个点都存了一些信息,用[L,R]表示下标从L到R的这些点。 线段...转载 2018-10-08 21:40:25 · 190 阅读 · 0 评论 -
E - Xenia and Bit Operations CodeForces - 339D 线段树
Xenia the beginner programmer has a sequencea, consisting of2nnon-negative integers:a1, a2, ..., a2n. Xenia is currently studying bit operations. To better understand how they work, Xenia decided ...原创 2019-04-14 17:31:47 · 165 阅读 · 0 评论 -
Picture 扫描线求周长
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. Each rectangle can be partially or totally covere...原创 2019-04-16 17:27:59 · 439 阅读 · 0 评论 -
Can you answer these queries III 线段树求区间最大字段和
题目: You are given a sequence A of N (N <= 50000) integers between -10000 and 10000. On this sequence you have to apply M (M <= 50000) operations: modify the i-th element in the sequence or for...原创 2019-03-28 22:00:46 · 713 阅读 · 2 评论 -
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 of end...原创 2019-04-01 22:05:58 · 142 阅读 · 0 评论 -
Mayor's posters 线段树+离散化
题目地址:http://poj.org/problem?id=2528 首先第一行要输入c,表示进行c个测试案例。题意大体是有n(1 <= n <= 10000)个人往墙上贴海报,每个人给出贴的范围li,ri(1 <= li<= ri <= 10000000),问最后还能看见多少海报(完整的不完整的都算). 先说一下什么是离散化,如果线段树要开的区间...原创 2019-03-28 09:44:30 · 130 阅读 · 0 评论 -
POJ 3667 Hotel 线段树+标记
Description: The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bessie, ever the competent travel agent, has...原创 2019-04-01 17:03:57 · 147 阅读 · 0 评论 -
A Simple Problem with Integers 线段树 区间更新
题目: You haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for...原创 2019-03-27 11:22:28 · 93 阅读 · 0 评论 -
HDU 4553 约会安排 线段树+优先级+区间最大子段
题目描述: 寒假来了,又到了小明和女神们约会的季节。 小明虽为屌丝级码农,但非常活跃,女神们常常在小明网上的大段发言后热情回复“呵呵”,所以,小明的最爱就是和女神们约会。与此同时,也有很多基友找他开黑,由于数量实在过于巨大,怎么安排时间便成了小明的一大心事。 我们已知小明一共有T的空闲时间,期间会有很多女神或者基友来找小明。 作为一个操作系统曾经怒考71分的大神,小明想到了一个...原创 2019-03-30 16:27:07 · 173 阅读 · 0 评论 -
HDU 1542 Atlantis 线段树+扫描线+离散化 矩形面积并
There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps describe diff...原创 2019-04-03 22:19:24 · 174 阅读 · 0 评论 -
An easy problem
题目描述: One day, a useless calculator was being built by Kuros. Let's assume that number X is showed on the screen of calculator. At first, X = 1. This calculator only supports two types of operation. ...原创 2018-10-10 17:12:46 · 336 阅读 · 0 评论 -
Billboard
题目描述: At the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible announcements are posted: ne...原创 2018-10-08 22:07:20 · 222 阅读 · 0 评论 -
I Hate It
题目描述: 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 输入: 本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,有两个正整数 N 和 M ( 0<N<=200000,0<M...原创 2018-10-08 21:52:50 · 113 阅读 · 0 评论 -
hdu 1255 覆盖的面积 扫描线求矩形面积交 离散化
给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积. Input 输入数据的第一行是一个正整数T(1<=T<=100),代表测试数据的数量.每个测试数据的第一行是一个正整数N(1<=N<=1000),代表矩形的数量,然后是N行数据,每一行包含四个浮点数,代表平面上的一个矩形的左上角坐标和右下角坐标,矩形的上下边和X轴平行,左右边和Y轴平行.坐标...原创 2019-04-17 22:06:38 · 308 阅读 · 0 评论