
RMQ
文章平均质量分 84
zqdnr
唯论成败,只求最强
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ 3264 RMQ模板
#include #include #include #include using namespace std ;const int N = 50000 + 11 ;int fmin[N][30] , fmax[N][30] ;int n , m ;void init() { for(int i = 1 ; i<= n ; ++i) { scanf("%d" ,&fma原创 2014-11-23 15:22:29 · 456 阅读 · 0 评论 -
POJ 3368 经典RMQ
下午开始写,编写边看动漫,果然写原创 2014-11-23 20:06:02 · 363 阅读 · 0 评论 -
HDU 2888 二维RMQ 模板
#include #include #include #include #include using namespace std ;const int N = 300 + 11 ;int dp[N][N][9][9] ;int n , m ;void init() { for(int i = 1 ; i <= n ; ++i) { for(int j = 1 ; j原创 2014-11-29 16:21:32 · 428 阅读 · 0 评论 -
ZOJ 2859 二维RMQ 二维线段树(树套树)
裸裸的二维RMQ,先用二维线段树写了一个;对于一个二维线段树(树套树),第一维下的每一个节点套着一颗树,而且套的每一树的形态都是一样的(就是该树的每一节点的长度的都是一样的),利用这点就可做到第一维套的树可以从它的子节点所套的树更新,当然若没有子节点,那么从它的第二维自己更新自己,这里说的更新是更新该节点所包含范围内的最小值;实现:1,在建树的时候,建一个N2,当为线段树第一维叶子原创 2014-12-06 20:41:49 · 491 阅读 · 0 评论