线段树
MekakuCityActors
这个作者很懒,什么都没留下…
展开
-
CF1197D Yet Another Subarray Problem [思维+线段树/dp]
传送门 题意:给一个长度为n的整数序列,定义一段连续子序列的价值为这段连续子序列之和sum(L,R) — k * f(len/m),其中k为给定的整数,len为这段连续子序列的长度,f(x)表示x向上取整,其中m为给定整数,求出连续子序列的最大价值 题解:这题并不难 (虽然我手残地写崩线段树wa了一个多小时还好最后几分钟过了)首先把 sum(L,R) — k * f(len)把sum(L,R)转化...原创 2019-09-09 17:17:58 · 170 阅读 · 0 评论 -
Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes[线段树+dp]
E. Pencils and Boxes time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Mishka received a gift of multicolored pencils for his birthday! Unfortun...原创 2019-07-26 22:33:04 · 206 阅读 · 0 评论 -
2019杭电多校第二场1012[线段树求区间覆盖]
1012 Longest Subarray Longest Subarray Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 873 Accepted Submission(s): 265 Problem Description...原创 2019-07-26 15:53:28 · 230 阅读 · 0 评论 -
2019杭电多校训练第二场1002[线段树/树状数组+dp]
1002 Beauty Of Unimodal Sequence Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 293 Accepted Submission(s): 84 Problem Description You ar...原创 2019-07-26 09:26:44 · 222 阅读 · 0 评论 -
hdoj4819 [二维线段树(线段树套线段树)]
传送门 题意:有一个n*n的二维数组,q次询问,每次询问一个二维区间的最大最小值并且将二维区间的中心的值更改为(最大值+最小值)/2 题解:rmq,如果不带修改则可以用倍增求rmq,带修改就用线段树,一维如此,二维也是如此,做的第一道二维线段树题,注意写法 #include<bits/stdc++.h> using namespace std; typedef long long l...原创 2019-09-19 11:58:37 · 316 阅读 · 0 评论