随笔分类 -  预处理-RMQ

摘要:Little Tommy is playing a game. The game is played on a 2D N x N grid. There is an integer in each cell of the grid. The rows and columns are numbered 阅读全文
posted @ 2018-10-18 15:20 真想不出名字了 阅读(216) 评论(0) 推荐(0) 编辑
摘要:Description You are given a sequence of n integers a1 , a2 , ... , an in non-decreasing order. In addition to that, you are given several queries cons 阅读全文
posted @ 2018-10-17 22:42 真想不出名字了 阅读(210) 评论(0) 推荐(0) 编辑
摘要:Problem Description Paul draw a big m*n matrix A last month, whose entries Ai,j are all integer numbers ( 1 <= i <= m, 1 <= j <= n ). Now he selects s 阅读全文
posted @ 2018-10-17 21:39 真想不出名字了 阅读(259) 评论(0) 推荐(0) 编辑
摘要:①一维RMQ (1) dp[i,j] 表示从第i个数起连续2j个数中的(最大值min、最小值max、最大公约数gcd……),通过更改下列代码中的红色函数即可实现。 (2) b数组放置所需查询的数列。 ②二维RMQ 给定一个n*m矩阵,每次询问左上角(r1,c1)到右下角(r2,c2)的子矩形中的(最 阅读全文
posted @ 2018-10-17 09:52 真想不出名字了 阅读(255) 评论(0) 推荐(0) 编辑
摘要:Problem Description Give you a sequence of N(N≤100,000) integers : a1,...,an(0<ai≤1000,000,000). There are Q(Q≤100,000) queries. For each query l,r yo 阅读全文
posted @ 2018-10-16 23:04 真想不出名字了 阅读(147) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示