
尺取
Tao_oc
加油
展开
-
尺取
1.sequence A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the mi...原创 2019-04-07 23:34:54 · 380 阅读 · 0 评论 -
F Planting Trees(单调队列,尺取)
Planting Trees 题意: 给一个矩阵,求一个面积最大的子矩阵,该子矩阵内部任意元素之差小于等于k 求有极差限制的最大面积子矩阵 解析: 考虑n^3的算法 遍历上边,遍历下边 遍历右边,维护最大区间范围 我们在这个范围存在一个单调性,如果l1>l2,(l2,r)不行,呢么(l1,r)肯定不行 所以我们用两个个单调队列维护区间最大和最小值 我们不断入队,如果(区间...原创 2019-07-27 11:16:59 · 212 阅读 · 0 评论