
RMQ
Joefery
生命不息,战斗不止。
展开
-
RMQ模版
/* 类型:RMQ模板 分析:用于求取区间最小值和最大值,修改值比较麻烦, O(nlogn)时间内进行预处理,O(1)时间内回答每个查询. */ #include #include #include #include #include using namespace std; typedef long long ll; int a[100005]; int Mi原创 2016-09-05 00:44:16 · 439 阅读 · 0 评论 -
CSU 1809 Parenthesis 【前缀和+RMQ】
Description Bobo has a balanced parenthesis sequence P=p 1 p 2…p n of length n and q questions. The i-th question is whether P remains balanced after p ai and p bi swapped. Note that questions原创 2016-09-05 00:25:11 · 735 阅读 · 0 评论