1、字符串方法endswith endswith方法: 其中suffix支持字符串构成的元组(tuple)。 输出结果为:False 2、os.path.splittext os.path.splittext():将文件名和扩展名分开,返回由文件名和扩展名构成的元组 os.path.split(): ...
分类:
其他好文 时间:
2018-12-04 10:11:25
阅读次数:
238
strings和strconv的使用 strings strings.HasPrefix(s string,preffix string) bool:判断字符串s是否以prefix开头 stirngs.HasSuffix(s string,suffix string) bool:判断字符串s是否以s ...
分类:
其他好文 时间:
2018-11-27 16:41:11
阅读次数:
196
AC自动机 queueq; struct Aho_Corasick_Automaton{ int c[N][26],val[N],fail[N],cnt; void ins(char s){ int len=strlen(s);int now=0; for(int i=0;i ...
分类:
其他好文 时间:
2018-11-26 20:13:32
阅读次数:
157
关键字if+trim trim可以去除多余的关键字,是where和set的组合 trim标记是一个格式化的标记,可以完成set或者是where标记的功能,如下代码: <trim prefix="" suffix="" suffixOverrides="" prefixOverrides=""></t ...
分类:
数据库 时间:
2018-11-02 23:51:26
阅读次数:
179
题意:给一个字符串,多组查询,一些后缀两两的lcp长度和,查询个数和不超过1e6 题解:svt就是后缀虚树,suffix virtual tree,考虑后缀树lca求lcp长度,但是查询次数可能很多,不能每次遍历,所以要建出虚数后在虚树上dp,对于一个节点考虑算贡献,对于所有子树,两两算个数乘积乘上 ...
分类:
其他好文 时间:
2018-11-02 17:59:09
阅读次数:
143
application.properties配置文件 spring.thymeleaf.prefix=classpath:/templates/ spring.thymeleaf.suffix=.htmlspring.thymeleaf.mode=LEGACYHTML5#spring.thymele ...
分类:
数据库 时间:
2018-10-22 14:52:23
阅读次数:
364
不定期更新 OIer 知识点 一 字符串 (1) Knuth-Morris-Pratt(2) Hash hash表(3) Trie(4) Aho-Corasick automaton(5) Suffix-Tree(后缀树)(6) Manacher(7) Huffman 二 动态规划(1) 背包dp( ...
分类:
其他好文 时间:
2018-10-03 20:48:36
阅读次数:
189
最近学习了一下后缀数组,模板原理以后再看,先记一下一些数组的含义。用以下这张图做例子: rank(i)代表第i个后缀的字典序排名 sa(i)代表排名为i的字典序对应的位置 lcp(i, j)表示suffix(i)和suffix(j)的公共最长前缀 height(i) = lcp(sa(i-1), s ...
分类:
编程语言 时间:
2018-09-20 01:03:12
阅读次数:
174
A cellular automaton is a collection of cells on a grid of specified shape that evolves through a number of discrete time steps according to a set of ...
分类:
其他好文 时间:
2018-09-18 17:16:10
阅读次数:
234
等号的使用 = 递归扩展 := 简单扩展 ?= 未定义则赋值 等号的使用 = 递归扩展 := 简单扩展 ?= 未定义则赋值 字符串处理 $(var:suffix=replacement) 替换,等效于:$(patsubst %suffix,%replacement,$(var)) $(foo:%.o ...
分类:
其他好文 时间:
2018-09-14 21:33:45
阅读次数:
200