Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2014-11-23 14:21:58
阅读次数:
205
In Java, if you want your own class to be a valid key type of the container, you just need to make it implement the interface "Comparable", and then i...
分类:
编程语言 时间:
2014-11-22 22:51:01
阅读次数:
272
如题,在用gem install rails时一直报这个错误,完整的错误信息如下:
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Connection ...
分类:
Web程序 时间:
2014-11-22 10:40:23
阅读次数:
186
用read4实现readn...至调用一次,感觉怎么搞都可以。。。估计这个题有II就是调用多次了。。。感觉多次勇哥buffer存下多读的那部分就好了。。。// Forward declaration of the read4 API.int read4(char *buf);class Soluti...
分类:
其他好文 时间:
2014-11-22 00:36:13
阅读次数:
259
题意:
给定一棵n(2000)个节点的树 每个节点上有个数字 问 有多少棵子树满足树中最大数字与最小数字的差不超过d
思路:
根据数据猜复杂度可能为n^2 想到尝试树形dp
假如枚举现在树中的最大值 那么最小值可以求出 这时不在数值范围内的节点都可以标记掉
那么假设这个最大值的点我一定选取 那么就可以dp出一定选这个点的情况下子树的种类数
假设u是父节点 v是子节点...
分类:
其他好文 时间:
2014-11-21 21:56:47
阅读次数:
212
Longest Valid ParenthesesGiven a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses sub...
分类:
其他好文 时间:
2014-11-21 20:31:10
阅读次数:
235
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the lon...
分类:
其他好文 时间:
2014-11-21 14:00:49
阅读次数:
172
Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express...
分类:
其他好文 时间:
2014-11-21 12:15:28
阅读次数:
149
ProblemIn 1-9 keypad one key is not working. If someone enters a password then not working key will not be entered. You have given expected password a...
分类:
其他好文 时间:
2014-11-21 06:58:11
阅读次数:
197
ProblemYou know a password is well-ordered string. Well-ordered string means that the order of the characters is in an alphabetical increasing order. ...
分类:
其他好文 时间:
2014-11-21 06:55:50
阅读次数:
137