
线段树
文章平均质量分 83
Chen_Jr_
某个正在奋斗的ACMer
展开
-
BZOJ1012(线段树/单调队列)
题目链接:点击打开链接题目描述:1012: [JSOI2008]最大数maxnumberTime Limit: 3 Sec Memory Limit: 162 MBSubmit: 12966 Solved: 5584[Submit][Status][Discuss]Description 现在请求你维护一个数列,要求提供以下两种操作:1、 查询操作。语法:Q L 功能:查询当前数列中末尾L个...原创 2018-04-11 23:17:53 · 251 阅读 · 0 评论 -
bzoj 5321(二分+优先队列+线段树)
传送门 题意: 给你一个长度为nnn的数组, 以及mmm个连续的区间。现在让你取恰好kkk个区间,你要将你选取的kkk个区间都加上aaa。现在要你最大化整个数组的最小值,即要最大化min{Ai}\min \{ A_i \}min{Ai} 题解: 最大化最小值,看到这样的词汇就非常二分了,于是乎我们就考虑采用二分答案解决。 于是乎,我们现在需要考虑的就是如何进行check\text{check}...原创 2019-03-27 20:23:26 · 192 阅读 · 0 评论 -
Codeforces 1108 E2(线段树+思维)
传送们 题意: 给你一个长度为nnn的数列b、b、b、以及mmm个区间。 你可以选取111个或多个这样的区间aia_iai,使得令区间a_i所对应的所有值b_i都加111。你最终要使得maxi=1nbi−mini=1nbi\max\limits_{i=1}^{n}b_i - \min\limits_{i=1}^{n}b_ii=1maxnbi−i=1minnbi 最大。 问你方案数以及...原创 2019-02-01 17:58:09 · 418 阅读 · 0 评论 -
Gym 101666M (线段树)
传送门 题面:PDF 题意: 给你一个起点s和终点e,有n个地点,问你在不增加从s到e的曼哈顿距离的前提下的能够到达的最多的地点的个数。 题目分析: 跟2018CCPC网络赛的一题(HDU 6447)一摸一样,只不过这个题中还需要讨论一下起点和终点的相对位置。 我们只需要先将y坐标离散化,并根据每个点的x坐标从小到大遍历,并且用线段树对这个点维护它的1到id[y...原创 2018-09-07 21:43:37 · 353 阅读 · 0 评论 -
POJ 2777(线段树+状态压缩)
传送门 题面: Count Color Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 51631 Accepted: 15566 Description Chosen Problem Solving and Program design as an optional course...原创 2018-08-30 17:58:23 · 498 阅读 · 0 评论 -
Codeforces 620E(线段树+dfs序+状态压缩)
传送门 题面: The New Year holidays are over, but Resha doesn't want to throw away the New Year tree. He invited his best friends Kerim and Gural to help him to redecorate the New Year tree. The New Year...原创 2018-08-30 17:43:27 · 295 阅读 · 0 评论 -
HDU 6447(线段树)
传送门 题面: YJJ is a salesman who has traveled through western country. YJJ is always on journey. Either is he at the destination, or on the way to destination. One day, he is going to travel from city...原创 2018-08-26 10:12:23 · 961 阅读 · 0 评论 -
BZOJ 2957(线段树)
传送门 题面: 2957: 楼房重建 Time Limit: 10 Sec Memory Limit: 256 MB Submit: 3437 Solved: 1631 [Submit][Status][Discuss] Description 小A的楼房外有一大片施工工地,工地上有N栋待建的楼房。每天,这片工地上的房子拆了又建、建了又拆。他经常无聊地看着窗外发呆,数自己能够看到...原创 2018-08-17 23:41:46 · 380 阅读 · 0 评论 -
HDU 6406(线段树)
传送门 题面: Taotao Picks Apples Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 1873 Accepted Submission(s): 587 Problem Description Th...原创 2018-08-17 23:30:04 · 1044 阅读 · 1 评论 -
HDU 6356(线段树)
传送门 题面: Glad You Came Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 829 Accepted Submission(s): 299 Problem Description Steve has ...原创 2018-08-06 22:15:23 · 681 阅读 · 0 评论 -
HDU 6315 (2018多校第二场)(线段树)
传送门 题面: Naive Operations Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 502768/502768 K (Java/Others) Total Submission(s): 650 Accepted Submission(s): 239 Problem Description In a gal...原创 2018-07-25 22:27:40 · 890 阅读 · 0 评论 -
ZOJ 3998(线段树)
传送门题面:Yet Another Data Structure ProblemTime Limit: 5 Seconds Memory Limit: 65536 KBGiven integers . There are 3 types of operations:1 l r v: Multiply by ;2 l r k: Change each element in to ;3...原创 2018-06-10 15:38:52 · 385 阅读 · 0 评论 -
HDU 6273(树状数组+思维)
传送门题面:Problem J. Master of GCDHakase has n numbers ina line. At first, they are all equal to 1. Besides, Hakase is interested in primes.She will choose a continuous subsequence [l,r] and a prime param...原创 2018-04-27 20:57:52 · 638 阅读 · 0 评论 -
bzoj 1798(线段树)
传送门 分析: 因为同时涉及两种区间更新操作,故考虑用两种lazytaglazytaglazytag去打标记。 而在我们进行区间加和区间乘的时候,我们会发现,因为乘法的优先级较加法的优先级要高,因此,为了方便处理,我们优先选择下放乘法标记。 同时我们需要注意,在我们下放乘法标记mulmulmul的时候,如果当前区间存在加法标记addaddadd,则我们需要在addaddadd的基础上乘上mulmu...原创 2019-05-29 21:35:58 · 284 阅读 · 0 评论