2015年9月19日

python 笔记4-- 函数式编程

摘要: 高阶函数 把函数作为参数传入,这样的函数称为高阶函数,函数式编程就是指这种高度抽象的编程范式。在python中 函数也是一种变量def add(x, y, f): return f(x) + f(y)map map()函数接收两个参数,一个是函数,一个是Iterable,... 阅读全文

posted @ 2015-09-19 17:05 DDUPzy 阅读(127) 评论(0) 推荐(0) 编辑

[裸KMP][HDU1711][Number Sequence]

摘要: 题意找到子串在母串出现的第一个位置解法裸的KMP特别的地方第一次不看模板自己敲的KMP#includeconst int maxn=100000;const int MAXN=1000000;int next[maxn];int S[MAXN];int T[maxn];int N,... 阅读全文

posted @ 2015-09-19 11:47 DDUPzy 阅读(121) 评论(0) 推荐(0) 编辑

python 笔记3--高级特性

摘要: 切片语法L[l:r] 取L[l],L[l+1]…L[r-2],L[r-1]L[l:r:m] 取L[l],L[l+m],L[l+2*m],L[l+3*m]….(满足l+n*m>> for key in d: print(key)迭代valuefor value... 阅读全文

posted @ 2015-09-19 09:16 DDUPzy 阅读(144) 评论(0) 推荐(0) 编辑

导航