树状数组
bootdubbo
这个作者很懒,什么都没留下…
展开
-
D. Array Restoration
Initially there was an array a consisting of n integers. Positions in it are numbered from 1 to n.Exactly q queries were performed on the array. During the i-th query some segment (li,ri) (1≤li≤ri≤n)...原创 2019-11-06 22:23:21 · 184 阅读 · 0 评论 -
POJ - 2299 Ultra-QuickSort
In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted i...原创 2019-08-01 15:18:31 · 115 阅读 · 0 评论 -
POJ - 2352 Stars
Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and ...原创 2019-08-01 15:20:14 · 141 阅读 · 0 评论 -
POJ - 1195 Mobile phones
Suppose that the fourth generation mobile phone base stations in the Tampere area operate as follows. The area is divided into squares. The squares form an S * S matrix with the rows and columns numbe...原创 2019-08-01 16:03:37 · 121 阅读 · 0 评论 -
Rikka with Cake
Rikka’s birthday is on June 12th. The story of this problem happens on that day.Today is Rikka’s birthday. Yuta prepares a big cake for her: the shape of this cake is a rectangular of n centimeters t...原创 2019-08-20 16:12:28 · 178 阅读 · 0 评论 -
P1972 [SDOI2009]HH的项链【查询区间不同的数】
题目描述HH 有一串由各种漂亮的贝壳组成的项链。HH 相信不同的贝壳会带来好运,所以每次散步完后,他都会随意取出一段贝壳,思考它们所表达的含义。HH 不断地收集新的贝壳,因此,他的项链变得越来越长。有一天,他突然提出了一个问题:某一段贝壳中,包含了多少种不同的贝壳?这个问题很难回答……因为项链实在是太长了。于是,他只好求助睿智的你,来解决这个问题。输入格式第一行:一个整数N,表示项链的长度。...原创 2019-08-31 21:07:17 · 189 阅读 · 0 评论 -
P4113 [HEOI2012]采花【求区间内数量大于1的数的不同数】
题目描述萧薰儿是古国的公主,平时的一大爱好是采花。今天天气晴朗,阳光明媚,公主清晨便去了皇宫中新建的花园采花。花园足够大,容纳了n朵花,花有c种颜色(用整数1-c表示),且花是排成一排的,以便于公主采花。公主每次采花后会统计采到的花的颜色数,颜色数越多她会越高兴!同时,她有一癖好,她不允许最后自己采到的花中,某一颜色的花只有一朵。为此,公主每采一朵花,要么此前已采到此颜色的花,要么有相当正确...原创 2019-09-10 17:54:51 · 183 阅读 · 0 评论 -
牛客 千万别用树套树
Bobo 精通数据结构!他想维护一个线段的集合 S。初始时,S 为空。他会依次进行 q 次操作,操作有 2 种。类型 1:给出 l, r,向集合 S 中插入线段 [l, r].类型 2:给出 l, r,询问满足[x,y]∈S[x,y]∈S[x,y]∈S且 x≤l≤r≤yx≤l≤r≤yx≤l≤r≤y 的线段 [x,y][x, y][x,y] 数量。帮 Bobo 求出每次询问的答案。nnn表...原创 2019-10-04 20:00:55 · 204 阅读 · 0 评论