Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's...
分类:
其他好文 时间:
2014-08-18 00:03:13
阅读次数:
189
一、检查系统版本是否手工升级[root@station253~]#uname-rlinux的内核版本号
2.6.32-358.el6.x86_64
[root@station253~]#cat/proc/version
Linuxversion2.6.32-358.el6.x86_64
[root@station253~]#cat/etc/issue系统安装时默认的发行版本
CentOSrelease6.4(Final)
[root@statio..
分类:
其他好文 时间:
2014-08-17 17:10:18
阅读次数:
404
G - Here Be DragonsThe Triwizard Tournament's third task is to negotiate a corridor of many segmen...
分类:
其他好文 时间:
2014-08-17 16:58:32
阅读次数:
227
Follow up for "Unique Paths":
Now consider if some obstacles are added to the grids. How many unique paths would there be?...
分类:
其他好文 时间:
2014-08-17 15:39:42
阅读次数:
221
题目大意:
计算[m,n]之间所有数字有多少个零。
解题思路:
可以用[0,m)之间和[0,n]之间有多少个零然后作差。
规律是计算所有位置在到当前数时有多少个零。
下面是代码:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#...
分类:
其他好文 时间:
2014-08-17 11:47:52
阅读次数:
194
Description
这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:
1.机器人一开始在棋盘的起始点并有起始点所标有的能量。
2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。
3.机器人不能在原地停留。
4.当机器人选择了一条可行路径后,当他走到这条路径的终点时,他将只有终点所标记的能量。
如...
分类:
其他好文 时间:
2014-08-16 23:52:21
阅读次数:
372
Description
Find Solutions
Look at the following equation:
c = ab - + 1
Now given the value of c, how many possible values of and
a and b are there (a and
b must be ...
分类:
其他好文 时间:
2014-08-16 22:33:01
阅读次数:
287
to get the ans of how many roads at most that can be built between two line without intersection of roads,we need sort the input sequence at ont edge ...
分类:
其他好文 时间:
2014-08-16 17:01:30
阅读次数:
288
Description
RPG battles
In many typical RPG games, you battle with bad guys, creatures, monsters or ghosts etc. all the time. After each battle, you may get magic potions th...
分类:
其他好文 时间:
2014-08-16 13:51:30
阅读次数:
245
题意: 有兩個人在玩遊戲,有N個數,FF會詢問TT,sum(a, b)=A[a] + ... +A[b]是多少,TT會告訴他正確的答案,也會告訴他錯誤的。要你統計錯誤的答案有多少組。(如果當前的是錯的統計完就直接忽略掉)总结:这道题花了我很长时间,结果还是看了别人的题解才想到的。其实就是一个小细节....
分类:
其他好文 时间:
2014-08-16 13:47:40
阅读次数:
185