You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one element from th ...
分类:
其他好文 时间:
2017-10-25 18:14:25
阅读次数:
170
Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. Note: The l ...
分类:
其他好文 时间:
2017-10-25 00:34:36
阅读次数:
151
Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. Note that it is th ...
分类:
其他好文 时间:
2017-10-24 16:07:33
阅读次数:
100
Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. For example, aft ...
分类:
其他好文 时间:
2017-10-24 13:18:46
阅读次数:
148
Note: This solution is combined with Trie + Generialized Abbreviation: 1. Since it looks for smallest one, we need persist a string to find minimum le ...
分类:
其他好文 时间:
2017-10-13 17:54:11
阅读次数:
144
两个有序的数组 nums1 和 nums2 维数分别为m,n。找所有数的中位数,复杂度 O(log (m+n)) 注意:奇偶个数,分治法求解,递归出口特殊处理。取Kth smallest数时,分治取mid=k/2和k-mid,避免奇数造成影响。 ...
分类:
其他好文 时间:
2017-10-09 19:34:58
阅读次数:
147
1. Use priority queue. Need to check whether one element has been double counted: 2 Binary search: For this kind of matrix, binary search should work ...
分类:
其他好文 时间:
2017-10-09 14:09:28
阅读次数:
126
先最大流跑一遍 在残存网络上把满流边容量+1 非满流边容量设为无穷大 在进行一次最大流即可 (这里的边都不包括建图时用于反悔的反向边) ...
分类:
其他好文 时间:
2017-10-01 23:44:32
阅读次数:
237
题目链接:HDU6214 留一个链式前向星+Dinic模板(希望不要被某人发现,嘿嘿嘿)。 ...
分类:
其他好文 时间:
2017-09-26 19:43:33
阅读次数:
181
#include <iostream>#include <string>#include <list> //we use the list container , because it is easy to sort and get the biggest number and smallest n ...
分类:
其他好文 时间:
2017-09-22 19:13:30
阅读次数:
122