区间最值查询RMQ
Lesroad
这个作者很懒,什么都没留下…
展开
-
RMQ模板题
给出一个有N个数的序列,编号0 - N - 1。进行Q次查询,查询编号i至j的所有数中,最大的数是多少。 例如: 1 7 6 3 1。i = 1, j = 3,对应的数为7 6 3,最大的数为7。(该问题也被称为RMQ问题) Input 第1行:1个数N,表示序列的长度。(2 第2 - N + 1行:每行1个数,对应序列中的元素。(0 i 第N + 2行:1个数Q,表示查询的数量原创 2017-08-19 12:17:52 · 358 阅读 · 0 评论 -
hdu1806——Frequent values
You are given a sequence of n integers a1 , a2 , ... , an in non-decreasing order. In addition to that, you are given several queries consisting of indices i and j (1 ≤ i ≤ j ≤ n). For each query, de原创 2017-08-19 14:05:34 · 309 阅读 · 0 评论 -
hdu3183——A Magic Lamp(RMQ)
Kiki 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 dreams. The questio原创 2017-08-19 14:14:39 · 465 阅读 · 0 评论