思路 0. 首先思考什么时候产生LIS上升的贡献,肯定是遇到了一个小于号啊,左边 4 大于号肯定不产生LIS的贡献了,。 假设上面想到了。 接下来考虑怎么找最短,和最长。 再等等,思考还有没有产生贡献的地方? 容易想到就是 小于号 与 小于号 之间 也会产生贡献。 比如 3424 using nam ...
分类:
其他好文 时间:
2020-02-29 17:34:26
阅读次数:
71
~~~ / 获取CPU序列号 @return CPU序列号(16位) 读取失败为"0000000000000000" / private static String getCPUSerial() { if (Build.VERSION.SDK_INT = Build.VERSION_CODES.O) ...
分类:
移动开发 时间:
2020-02-28 18:59:17
阅读次数:
96
最多有K个不同字符的最长子串。题意就不解释了,参见159题。例子, Example 1: Input: s = "eceba", k = 2 Output: 3 Explanation: T is "ece" which its length is 3. Example 2: Input: s = ...
分类:
其他好文 时间:
2020-02-28 15:37:15
阅读次数:
51
最多有两个不同字符的最长子串。题意是给一个字符串,请返回一个最长子串的长度。子串的要求是最多只有两个不同的字母。例子, Example 1: Input: "eceba" Output: 3 Explanation: tis "ece" which its length is 3. Example ...
分类:
其他好文 时间:
2020-02-28 13:52:03
阅读次数:
68
//获取url参数 getQueryVariable(variable){ var query =decodeURIComponent(window.location.search.substring(1)); var vars = query.split("&"); for (var i=0;i< ...
分类:
Web程序 时间:
2020-02-27 19:01:53
阅读次数:
82
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.Your algorithm should run in O(n) complexity.Example... ...
分类:
其他好文 时间:
2020-02-27 11:41:45
阅读次数:
73
代码: #include<iostream> #include<stdio.h> using namespace std; const int maxn = 1001; int a[maxn],dp[maxn]; int main(){ int n; cin>>n; for(int i=1;i<=n ...
分类:
其他好文 时间:
2020-02-26 18:32:51
阅读次数:
54
/* 导入合适的包*/ public static String generateCode(int len){ len = Math.min(len, 8); int min = Double.valueOf(Math.pow(10, len - 1)).intValue(); int num = ...
分类:
其他好文 时间:
2020-02-25 18:18:27
阅读次数:
81
var filters = { toFix: function (value) { return parseFloat(value).toFixed(2)//此处2为保留两位小数 }, telvague: function(val) { //将手机号中间4位数变成* return val ? (va ...
分类:
移动开发 时间:
2020-02-25 13:18:51
阅读次数:
101