
线段树
文章平均质量分 68
linalw
投入时间 不惧无获
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
A - Range Minimum Query (RMQ) (cugb2023-s)
Write a program which manipulates a sequence A = {a0, a1, . . . , an-1} with the following operations:Note that the initial values of ai (i = 0, 1, . . . , n−1) are 231-1.n qcom0 x0 y0com1 x1 y1...comq−1 xq−1 yq−1In the first line原创 2022-07-12 16:20:20 · 210 阅读 · 0 评论 -
H - 敌兵布阵 (cugb2023-s)
C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。中央情报局要研究敌人究竟演习什么战术,所以Tidy要随时向Derek汇报某一段连续的工兵营地一共有多少人,例如Derek问:“Tidy,马上汇报第3个营地原创 2022-07-12 15:51:44 · 131 阅读 · 0 评论 -
G - RMQ and RAQ (cugb2023-s)
Write a program which manipulates a sequence AA = {a_0, a_1, ..., a_{n-1}a0,a1,...,an−1} with the following operations:Note that the initial values of a_i ( i = 0, 1, ..., n-1 )ai(i=0,1,...,n−1) are 0.nn qqquery_1query1query_2query2:query_qquery原创 2022-07-12 15:15:29 · 153 阅读 · 0 评论 -
F - RSQ and RAQ (cugb2023-s)
Write a program which manipulates a sequence A = {a1, a2, . . . , an} with the following operations:Note that the initial values of ai (i = 1, 2, . . . , n) are 0.n qquery1query2:queryqIn the first line, n (the number of elements in A) and q (the n原创 2022-07-12 14:33:34 · 200 阅读 · 0 评论 -
E - RMQ and RUQ (cugb2023-s)
Write a program which manipulates a sequence A = {a0, a1, . . . , an−1} with the following operations:Note that the initial values of ai (i = 0, 1, . . . , n−1) are 231-1.n qquery1query2:queryqIn the first line, n (the number of elements in A) and原创 2022-07-12 12:03:44 · 193 阅读 · 0 评论