
线段树
永夜莫明
菜是原罪
展开
-
线段树区间更新lazy
Color the ball线段树区间更新lazyN个气球排成一排,从左到右依次编号为1,2,3…N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过几次颜色吗?Input每个测试实例第一行为一个整数N,(N <= 1...原创 2018-10-29 23:39:48 · 307 阅读 · 0 评论 -
Restore Permutation(思维+线段树)
https://codeforces.com/contest/1208/problem/DD. Restore Permutationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAn array of...原创 2019-08-27 01:30:44 · 800 阅读 · 0 评论 -
Lexical Sign Sequence(贪心+线段树+set二分)
问题 G: Lexical Sign Sequence问题 G: Lexical Sign Sequence时间限制: 1 Sec内存限制: 128 MB提交: 91解决: 12[提交] [状态] [命题人:admin]题目描述Andi likes numbers and sequences, especially, sign sequences. A sign ...原创 2019-08-26 22:25:00 · 286 阅读 · 0 评论 -
Governing sand(权值线段树+离散化)
链接:https://ac.nowcoder.com/acm/contest/887/C来源:牛客网时间限制:C/C++ 3秒,其他语言6秒空间限制:C/C++ 65536K,其他语言131072K64bit IO Format: %lld题目描述The Wow village is often hit by wind and sand,the sandstorm serio...原创 2019-08-08 22:17:38 · 198 阅读 · 0 评论 -
Snowy Smile(线段树维护子矩阵最大值/降维打击维护子矩阵最大值(TLE))
http://acm.hdu.edu.cn/showproblem.php?pid=6638问题 E: Snowy Smile时间限制: 4 Sec内存限制: 128 MB提交: 54解决: 9[提交] [状态] [命题人:admin]题目描述There are n pirate chests buried in Byteland, labeled by 1,2,…...原创 2019-08-08 01:10:04 · 371 阅读 · 0 评论 -
Buy Tickets
Fast Arrangement线段树倒序处理Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the ...原创 2018-11-03 21:04:38 · 175 阅读 · 1 评论 -
Minimum Inversion Number (线段树解决逆序数问题)
Minimum Inversion Number线段树解决逆序数问题The inversion number of a given number sequence a1, a2, …, an is the number of pairs (ai, aj) that satisfy i < j and ai > aj.For a given sequence of numbers ...原创 2018-11-03 20:59:41 · 1137 阅读 · 0 评论 -
Fast Arrangement (线段树区间更新)
Fast Arrangement线段树区间更新Chinese always have the railway tickets problem because of its’ huge amount of passangers and stations. Now goverment need you to develop a new tickets query system.One train...原创 2018-11-01 20:41:48 · 280 阅读 · 0 评论 -
线段树区间更新区间查询(Just a Hook)
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 s...原创 2018-10-30 16:36:21 · 386 阅读 · 0 评论 -
线段树单点更新区间查询
敌兵布阵线段树单点更新区间查询C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。中央情报...原创 2018-10-29 23:44:49 · 163 阅读 · 0 评论 -
Different GCD Subarray Query(离线+线段树)
https://cn.vjudge.net/problem/HDU-5869Problem DescriptionThis is a simple problem. The teacher gives Bob a list of problems about GCD (Greatest Common Divisor). After studying some of them, Bob th...原创 2019-08-30 11:46:40 · 233 阅读 · 0 评论