Given a string s and a dictionary of words
dict, determine if s can be segmented into a space-separated sequence of one or
more dictionary words.For e...
分类:
其他好文 时间:
2014-07-22 23:08:32
阅读次数:
383
题目链接:uva 10773 - Back to Intermediate Math
题目大意:有一天河,宽d,水流速度v,船速u,问说垂直过河和最快过河的时间差,如果不能过河输出“can't determine”。
解题思路:将u的速度分解成水平方向和竖直方向的两个速度,使水平方向速度恰好为v,船即可垂直过河,速度为竖直方向速度。
#include
#includ...
分类:
其他好文 时间:
2014-07-22 23:04:12
阅读次数:
235
Given a binary tree, determine if it is
height-balanced.For this problem, a height-balanced binary tree is defined as a
binary tree in which the depth...
分类:
其他好文 时间:
2014-05-01 14:38:39
阅读次数:
454
这道题挺简单的,但是需要细心。最好的方法是先对string做预处理,然后再判断是否是回文。下面是AC代码:
1 /** 2 * Given a string, determine if it is a palindrome, considering only
alphanumeric ch...
分类:
其他好文 时间:
2014-05-01 01:45:34
阅读次数:
375