Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which...
分类:
其他好文 时间:
2014-07-30 11:30:33
阅读次数:
247
function string10to62(number) { var chars = '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ'.split(''), radix = chars.length...
分类:
编程语言 时间:
2014-07-30 11:27:03
阅读次数:
374
今天,和大家分享一道关于进制问题中的循环移位,大家应该知道,系统语言中提供的按位左移《和按位右移》都是非循环的。那什么叫循环移位呢?所谓循环移位是指在移位时不丢失移位前原范围的位,而是将它们作为另一端的补入位。例如循环右移n位,指各位右移n位,原来的低n位变成..
分类:
编程语言 时间:
2014-07-30 10:10:53
阅读次数:
206
大意:n次操作原串查询逆序数,求出所有串中最小的逆序数。求逆序数属于线段树的统计问题,建立空树,每次进行插点时进行一次query操作即可。n次操作可以套用结论:如果是0到n的排列,那么如果把第一个数放到最后,对于这个数列,逆序数是减少a[i],而增加n-1-a[i]。 1 #include 2 #....
分类:
其他好文 时间:
2014-07-30 09:46:43
阅读次数:
163
题目:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may com....
分类:
编程语言 时间:
2014-07-30 05:35:13
阅读次数:
260
题目:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may com....
分类:
编程语言 时间:
2014-07-30 05:35:03
阅读次数:
309
题目: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [?2,1,?3,4,?1...
分类:
编程语言 时间:
2014-07-30 05:34:43
阅读次数:
319
目前在Javascript中,已经存在一些标准的类,例如Date、Array、RegExp、String、Math、Number等等,这为我们编程提供了许多方便。但对于复杂的客户端程序而言,这些还远远不够。? 与Java不同,Java2提供给我们的...
分类:
Web程序 时间:
2014-07-30 03:32:43
阅读次数:
378
http://acm.hdu.edu.cn/showproblem.php?pid=2795
多校的第一场和第三场都出现了线段树,比赛期间没做,,这两天先做几道热身下,然后31号之前把那两道多校的线段树都搞了,这是一道热身题
关键是建模:
首先一定看清楚题目构造的场景,看有什么特点--------会发现,如果尽量往左上放置的话,那么由于 the i-th announcement is a ...
分类:
其他好文 时间:
2014-07-30 01:02:12
阅读次数:
249
Oracle常用函数 ——TRUNC,TO_DATE,TO_CHAR,TO_NUMBER, SUBSTR,REPLACE,NVL ,TRIM,wm_concat,upper, lower,length,add_months(sysdate,1)...
分类:
数据库 时间:
2014-07-30 01:01:12
阅读次数:
499