摘要: 1. 概述 RMQ(Range Minimum/Maximum Query),即区间最值查询,是指这样一个问题:对于长度为n的数列A,回答若干询问RMQ(A,i,j)(i,jO(nlogn) { for(int j = 1; j using namespace std... 阅读全文
posted @ 2015-04-21 15:30 星斗万千 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2015-04-21 15:03 星斗万千 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Description N(3 #include #include #include using namespace std; struct node { int data,id; }p[20020]; int C[20020],n; bool cmp(node a,node b... 阅读全文
posted @ 2015-04-21 13:54 星斗万千 阅读(120) 评论(0) 推荐(0) 编辑