https://leetcode.com/problems/smallest-range/description/ 给你k个数组,找一个最小区间[a,b],可以包含k个数组中的数字各至少一个。 滑动窗口题。 对于要求“最短”的题目很适用。 points: 1.在扩张右界的时候,一旦碰到合法就停止,但 ...
分类:
其他好文 时间:
2018-09-13 14:25:14
阅读次数:
155
https://stackoverflow.com/questions/5975741/what-is-the-difference-between-ll-and-lr-parsing http://blog.reverberate.org/2013/07/ll-and-lr-parsing-dem ...
分类:
其他好文 时间:
2018-09-11 18:03:28
阅读次数:
143
def findsmallest(arr): smallest=arr[0] smallest_index=0 for i in range(1,len(arr)): #smallest_index+=1 if arr[i]<=smallest: smallest=arr[i] smallest_i ...
分类:
编程语言 时间:
2018-09-09 20:32:16
阅读次数:
208
set集合是一种无序不重复的集合 add (self, *args, **kwargs) 添加元素 clear (self, *args, **kwargs) 清空内容 update (self, *args, **kwargs) 可添加多个元素,更新 difference (self, *args ...
分类:
其他好文 时间:
2018-09-09 19:50:48
阅读次数:
332
Description Give you a number S of length n,you can choose a position and remove the number on it.After that,you will get a new number. More formally, ...
分类:
其他好文 时间:
2018-09-01 20:23:35
阅读次数:
143
For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, product and quotient. Input Sp ...
分类:
其他好文 时间:
2018-08-31 17:09:12
阅读次数:
191
题目链接 https://leetcode.com/problems/kth smallest element in a bst/description/ 题目描述 Given a binary search tree, write a function kthSmallest to find th ...
分类:
其他好文 时间:
2018-08-28 14:26:01
阅读次数:
154
Difference bzoj-2213 Poi-2011 题目大意:已知一个长度为n的由小写字母组成的字符串,求其中连续的一段,满足该段中出现最多的字母出现的个数减去该段中出现最少的字母出现的个数最大。求这个个数。 注释:$1\le n\le 10^6$。 想法:“在线”的dp题。 状态:$dp[ ...
分类:
其他好文 时间:
2018-08-26 14:45:44
阅读次数:
112
[抄题]: 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 f ...
分类:
其他好文 时间:
2018-08-24 10:48:20
阅读次数:
194