原题链接在这里:https://leetcode.com/problems/kth-largest-element-in-a-stream/description/ 题目: Design a class to find the kth largest element in a stream. Not ...
分类:
其他好文 时间:
2018-10-14 11:39:49
阅读次数:
176
1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int maxn=1e5+7; 7 int n,fr1,fr2,tl1,tl2,ans; 8 int h[maxn],l[maxn],r[maxn],... ...
分类:
其他好文 时间:
2018-10-13 02:30:36
阅读次数:
190
Given a non-negative integer N, find the largest number that is less than or equal to N with monotone increasing digits. (Recall that an integer has m ...
分类:
其他好文 时间:
2018-10-11 23:44:51
阅读次数:
216
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. Example: Input: [ ["1","0","1"," ...
分类:
其他好文 时间:
2018-10-11 10:24:58
阅读次数:
112
题目描述 在未排序的数组中找到第 k 个最大的元素。请注意,你需要找的是数组排序后的第 k 个最大的元素,而不是第 k 个不同的元素。 示例 1: 示例 2: 说明: 你可以假设 k 总是有效的,且 1 ≤ k ≤ 数组的长度。 解题思路 利用快速排序的思想,在进行排序过程中每次可以确定一个元素的最 ...
分类:
编程语言 时间:
2018-10-10 12:00:21
阅读次数:
197
You have a list of points in the plane. Return the area of the largest triangle that can be formed by any 3 of the points. Example: Input: points = [[ ...
分类:
其他好文 时间:
2018-10-06 14:32:55
阅读次数:
148
题面题意:给你N个男生,N个女生,男生与男生之间都是朋友,女生之间也是,再给你m个关系,告诉你哪些男女是朋友,最后问你最多选几个人出来,大家互相是朋友. N最多为20 题解:很显然就像二分图了,男生一边女生一边的,然后一种解法就是 求图的最大独立集,(看起来很巧,实则也是一种套路) (最大独立集是一 ...
分类:
其他好文 时间:
2018-10-05 17:19:39
阅读次数:
206
Given a list of non negative integers, arrange them such that they form the largest number. Example 1: Input: [10,2] Output: "210" Example 2: Input: [ ...
分类:
其他好文 时间:
2018-10-04 09:27:23
阅读次数:
114
Largest Rectangle in a Histogram Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 26987 Accepted: 8727 Description A histogram is a polygon ...
分类:
其他好文 时间:
2018-10-03 22:32:05
阅读次数:
198
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Inpu ...
分类:
编程语言 时间:
2018-09-30 22:42:20
阅读次数:
234