min-height】的更多相关文章

模板奉上 int rank[maxn],height[maxn]; void calheight(int *r,int *sa,int n) { ; ;i<=n;i++) rank[sa[i]]=i; ;i<n;height[rank[i++]]=k) ,j=sa[rank[i]-];r[i+k]==r[j+k];k++) //求h[i] = height[rank[i]]; ; return; } 概念: (1)height 数组:定义height[i]=suffix(SA[i-1])和su…
实现大概是下面的效果,写了比较详细的注释 <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> </head> <style type="text/css">body{padding:0;margin:0;}img{border:none;}a{text-decoration:none;co…
最近在学习自定义view  一遍看一别学顺便记录一下 1.View的测量-------->onMeasure() 首先,当我们要画一个图形的时候,必须知道三个数据:位置,长度,宽度   才能确定应该在哪个位置画多大的图形.这就是onMeasure方法存在的意义 测量的模式有三种: 1.EXACTLY:             精确模式                    当我们把布局的宽度高度设为指定数值,或者match_parent时系统指定的是这种模式 2.AT MOST:        …
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. For example, Given [0,1,0,2,1,0,1,3,2,1,2,1], return 6. The above elevation map is represented by a…
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a containe…
炎炎夏日,还是呆在空调房里切切题吧. Container With Most Water,题意其实有点噱头,简化下就是,给一个数组,恩,就叫 height 吧,从中任选两项 i 和 j(i <= j),使得 Math.min(height[i], height[j]) * (j - i) 最大化,求解这个最大值. O(n^2) O(n^2) 复杂度的解法非常容易想到,直接两两枚举. var maxArea = function(height) { var len = height.length;…
Array 448.找出数组中所有消失的数 要求:整型数组取值为 1 ≤ a[i] ≤ n,n是数组大小,一些元素重复出现,找出[1,n]中没出现的数,实现时时间复杂度为O(n),并不占额外空间 思路1:(discuss)用数组下标标记未出现的数,如出现4就把a[3]的数变成负数,当查找时判断a的正负就能获取下标 tips:注意数组溢出 public List<Integer> findDisappearedNumbers(int[] nums) { List<Integer> d…
一直直到bug-free.不能错任何一点. 思路不清晰:刷两天. 做错了,刷一天. 直到bug-free.高亮,标红. 185,OA(YAMAXUN)--- (1) findFirstDuplicate string in a list of string. import java.util.HashSet; import java.util.Set; public class Solution { public static void main(String[] args) { String[…
题目描述: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a co…
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a containe…