1、题目 53. Maximum Subarray——Easy Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum a ...
分类:
其他好文 时间:
2020-02-07 20:25:50
阅读次数:
71
简介 整体二分利用的是分治的思想,可以解决一些区间 kth 问题,是一种离线算法,可以对比主席树算法。 限制 题目需要满足以下条件: 1. 询问的答案具有可二分性 2. 修改对判定答案的贡献互相独立 ,修改之间互不影响效果 3. 修改如果对判定答案有贡献,则贡献为一确定的与判定标准无关的值 4. 贡 ...
分类:
其他好文 时间:
2020-02-06 23:08:26
阅读次数:
95
Given a binary tree rooted at root, the depth of each node is the shortest distance to the root. A node is deepest if it has the largest depth possibl ...
分类:
其他好文 时间:
2020-02-06 11:07:31
阅读次数:
74
976. Largest Perimeter Triangle(三角形的最大周长) 链接 https://leetcode cn.com/problems/largest perimeter triangle 题目 给定由一些正数(代表长度)组成的数组 A,返回由其中三个长度组成的、面积不为零的三角 ...
分类:
其他好文 时间:
2020-02-05 11:29:30
阅读次数:
56
题目链接 https://leetcode-cn.com/problems/kth-largest-element-in-a-stream/ 题目内容 设计一个找到数据流中第K大元素的类(class)。注意是排序后的第K大元素,不是第K个不同的元素。你的 KthLargest 类需要一个同时接收整数 ...
分类:
编程语言 时间:
2020-02-05 09:31:29
阅读次数:
75
链接: "LeetCode668" 给定高度m?、宽度n 的一张?m n的乘法表,以及正整数k,你需要返回表中第k?小的数字。 例?1: 输入: m = 3, n = 3, k = 5 输出: 3 解释: 乘法表: 1 2 3 2 4 6 3 6 9 第5小的数字是 3 (1, 2, 2, 3, 3 ...
分类:
其他好文 时间:
2020-02-03 12:00:25
阅读次数:
61
Given a 2D grid of 0s and 1s, return the number of elements in the largest square subgrid that has all 1s on its border, or 0 if such a subgrid doesn' ...
分类:
其他好文 时间:
2020-02-02 13:34:56
阅读次数:
73
题目描述Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1... ...
分类:
其他好文 时间:
2020-02-01 12:30:58
阅读次数:
94
Find the largest palindrome made from the product of two n-digit numbers. Since the result could be very large, you should return the largest palindro ...
分类:
编程语言 时间:
2020-02-01 10:47:36
阅读次数:
78
"题目" 题意:给你一个数组,让你把数组里的元素组合起来,组合成的新数字最大 题解:把数字给排个序,但是排序的标准是啥呢?两个数字孰大孰小呢?判断标准就是两个数字分别前后组合,得出的数字哪个大,则前面的那个数字就大。 一开始我的思路错了,根据数字每个位上的数字判断,这样反而是变得更加复杂了! ...
分类:
编程语言 时间:
2020-01-27 20:39:59
阅读次数:
62