
线性结构——ST表与RMQ
Alex_McAvoy
想要成为渔夫的猎手
展开
-
线性结构 —— ST 表与 RMQ
【概述】RMQ(Range Minimum/Maximum Query),是对于长度为 n 的数列 A,回答若干次询问 RMQ(i,j),返回数列 A 中下标在区间 [i,j] 中的最值,即:区间最值查询问题目前常用于解决 RMQ 问题的方法为 ST 算法(Sparse Table),利用 ST 算法预处理打出的表,称为 ST 表。【ST 算法】对于 RMQ 问题,给出 n 个数 ...原创 2019-02-15 18:51:15 · 782 阅读 · 0 评论 -
A Magic Lamp(HDU-3183)
Problem DescriptionKiki likes traveling. One day she finds a magic lamp, unfortunately the genie in the lamp is not so kind. Kiki must answer a question, and then the genie will realize one of her ...原创 2019-02-15 18:48:15 · 382 阅读 · 0 评论 -
Find the hotel(HDU-3193)
Problem DescriptionSummer again! Flynn is ready for another tour around. Since the tour would take three or more days, it is important to find a hotel that meets for a reasonable price and gets as ...原创 2019-02-15 18:49:10 · 560 阅读 · 0 评论 -
Check Corners(HDU-2888)
Problem DescriptionPaul draw a big m*n matrix A last month, whose entries Ai,j are all integer numbers ( 1 <= i <= m, 1 <= j <= n ). Now he selects some sub-matrices, hoping to find the...原创 2019-02-15 18:50:12 · 503 阅读 · 0 评论 -
平衡的阵容(洛谷-P2880)
题目描述每天,农夫 John 的N(1 <= N <= 50,000)头牛总是按同一序列排队. 有一天, John 决定让一些牛们玩一场飞盘比赛. 他准备找一群在对列中为置连续的牛来进行比赛. 但是为了避免水平悬殊,牛的身高不应该相差太大. John 准备了Q (1 <= Q <= 200,000) 个可能的牛的选择和所有牛的身高 (1 <= 身高 <= ...原创 2019-08-03 16:26:07 · 469 阅读 · 0 评论 -
Balanced Lineup(POJ-3264)
Problem DescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the...原创 2019-08-03 16:38:47 · 191 阅读 · 0 评论