https://leetcode-cn.com/problems/longest-increasing-subsequence/ 1、题目: 给定一个无序的整数数组,找到其中最长上升子序列的长度。 示例: 输入: [10,9,2,5,3,7,101,18]输出: 4 解释: 最长的上升子序列是 [2 ...
分类:
其他好文 时间:
2020-07-19 23:31:12
阅读次数:
70
1 <html lang="en"> 2 3 <head> 4 <meta charset="UTF-8"> 5 <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maxim ...
分类:
Web程序 时间:
2020-07-16 18:24:38
阅读次数:
73
题意:E、Maximum Subsequence Value 题意: 给你n 个元素,你挑选k个元素,那么这个 k 集合的值为 ∑2i,其中,若集合内至少有 max(1,k?2)个数二进制下第 i 位为 1,则第 i 位有效,求一个集合可以得到的最大值。 题解: 应该是一种贪心 当k==3的时候,那 ...
分类:
其他好文 时间:
2020-07-16 12:01:31
阅读次数:
44
地址:https://leetcode-cn.com/problems/maximum-lcci/ <?php /** 编写一个方法,找出两个数字a和b中最大的那一个。不得使用if-else或其他比较运算符。 示例: 输入: a = 1, b = 2 输出: 2 */ class Solution ...
分类:
其他好文 时间:
2020-07-15 22:43:51
阅读次数:
79
效果图 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user ...
分类:
Web程序 时间:
2020-07-14 18:34:16
阅读次数:
252
D. Odd-Even Subsequence 题意 给出一个数组 a ,让你选择一个 a 的子序列,使得 \(min(max(a_1,a_3,a_5...),max(a_2,a_4,a_6...))\) 最小。 即奇数位置的最大值和偶数位置的最大值 的最小值最小。 思路 其实做这道题我还是很懵逼的 ...
分类:
其他好文 时间:
2020-07-14 16:37:29
阅读次数:
54
Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray). 找最长连续上升子序列 class Solution(object): def f ...
分类:
其他好文 时间:
2020-07-14 00:26:48
阅读次数:
59
这个东西都已经烂大街了啊,但是我还是想写一下。其实很简单,直接看源码就行。 打开ThreadPoolExecutor.java,搜索他的构造方法,一共看到4个。我们直接看参数最多的一个 /** * Creates a new {@code ThreadPoolExecutor} with the g ...
分类:
编程语言 时间:
2020-07-11 23:03:36
阅读次数:
67
Maximum Width of Binary Tree (M) 题目 Given a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maxim ...
分类:
其他好文 时间:
2020-07-10 10:11:00
阅读次数:
54
Given a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maximum width among all levels. The binar ...
分类:
其他好文 时间:
2020-07-10 10:07:44
阅读次数:
60