RMQ(区间最大值,最小值)问题的解决,ST表的应用。...
分类:
其他好文 时间:
2014-08-14 01:38:27
阅读次数:
198
最近公共祖先(Least Common Ancestor)的两种解决方式,在线RMQ算法和离线Tarjan算法,并且整理成为模板。...
分类:
其他好文 时间:
2014-08-14 01:33:07
阅读次数:
374
思路:这题下午搞了然后一直WA,后面就看了Discuss,里面有个数组:ABCDEFDCBA,这个我输出ABCD,所以错了。
然后才知道自己写的后缀数组对这个回文子串有bug,然后就不知道怎么改了。
然后看题解,里面都是用RMQ先预处理任意两个后缀的最长公共前缀,因为不太知道这个,所以又看了一下午,嘛嘛……
然后理解RMQ和后缀一起用的时候才发现其实这里不用RMQ也可以,只要特殊处理一下上面...
分类:
其他好文 时间:
2014-08-13 22:23:47
阅读次数:
261
_.range(),主要用于区间的获取操作。参数说明:(param1):范围上限,(param1,param2):起始及结束范围,(param1,param2,param3):起始结束范围,正数则为区间跨度,-1则为:负数区间跨度。_.range(10);=> [0, 1, 2, 3, 4, 5, ...
分类:
其他好文 时间:
2014-08-13 17:41:56
阅读次数:
197
--查看partition的四个视图select * from sys.partition_functions--查看分区函数select * from sys.partition_parametersselect * from sys.partition_range_values--查看分区函数对...
分类:
数据库 时间:
2014-08-12 21:53:04
阅读次数:
181
def bubble_sort(list):
for i in range(len(list)):
for j in (range(i,len(list))):
if list[j]
temp = list[j]
list[j] = list[i]...
分类:
编程语言 时间:
2014-08-12 17:27:54
阅读次数:
216
def select_sort(list):
for i in range(len(list)):
position = i
for j in range(i,len(list)):
if list[position] > list[j]:
position = j
temp = list[i]
list[i] = list[position]
list[pos...
分类:
编程语言 时间:
2014-08-12 17:25:34
阅读次数:
236
def insert_sort(list):
for i in range(len(list)):
while i > 0 and list[i] < list[i-1]:
temp = list[i]
list[i] = list[i-1]
list[i-1] = temp
i = i-1...
分类:
编程语言 时间:
2014-08-12 17:25:24
阅读次数:
269
在Python中没有switch语句If语句if condition:do sthelif condition: Do sthelse: Do sthwhile语句有一个可选的else从句while condition: do sthelse: do sthfor循环for i in range(1...
分类:
编程语言 时间:
2014-08-12 16:38:44
阅读次数:
193
(define (range n) (define (recur n) (if (= n -1) '() (cons n (recur (- n 1))))) (recur (- n 1)))(define (flatten a)...
分类:
其他好文 时间:
2014-08-12 16:24:34
阅读次数:
183