
RMQ
h_lizeming
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
RMQ(入门)
RMQ(Range Minimum/Maximum Query),即区间最值查询,是指这样一个问题:对于长度为n的数列A,回答若干次询问RMQ(i,j),返回数列A中下标在区间[i,j]中的最小/大值。 本文介绍一种比较高效的ST算法解决这个问题。ST(Sparse Table)算法可以在O(nlogn)时间内进行预处理,然后在O(1)时间内回答每个查询。 其实RMQ的思路比较好理解,...原创 2018-08-14 09:04:54 · 657 阅读 · 0 评论 -
A - Negative Score SPOJ - RPLN (模板题)
Orianna is a great swimmer and she's going to a swimming competition this month and needs your help as she is highly paranoic about the results of the competition. The competition consists in some so...原创 2018-08-14 09:04:43 · 309 阅读 · 0 评论 -
J - R2D2 and Droid Army
An army of n droids is lined up in one row. Each droid is described by m integers a1, a2, ..., am, where ai is the number of details of the i-th type in this droid's mechanism. R2-D2 wants to destroy ...原创 2018-08-13 09:26:20 · 264 阅读 · 0 评论