拉两次车,第一次假设最长回文串就在两边 第二次,先使得左右两边判回文,在将剩下的串 在manachar一遍, 比较两种情况取最大值,然后就是输出问题见代码 #include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 5; ...
分类:
其他好文 时间:
2020-03-31 01:01:15
阅读次数:
71
有一种特殊的集合叫做PFS(Prefix Free Set)集合。一个PFS集合由若干字符串构成,且不存在一个字符串是另一个字符串的前缀。空集也被看作是PFS集合。例如 {"hellohello"} 和 {"hellohello", "goodbyegoodbye", "giantgiant", " ...
分类:
其他好文 时间:
2020-03-30 23:05:13
阅读次数:
88
cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula git log --follow icu4c.rb git checkout -b icu4c-63.1 bc0c97952453ff6afc146aa3 ...
分类:
Web程序 时间:
2020-03-30 19:23:59
阅读次数:
211
linux 内核优化 默认情况下,linux系统有一些限制,并不能直接支持高并发性能,需要做一些内核优化。 1、把以下内容加入 /etc/sysctl.conf 1 net.ipv4.ip_forward=1 2 net.ipv4.tcp_syncookies = 1 3 net.ipv4.tcp_ ...
分类:
系统相关 时间:
2020-03-30 16:11:40
阅读次数:
90
Trie/前缀树/字典树 Trie (发音为 "try") 或前缀树是一种树数据结构,用于检索字符串数据集中的键。 一种树形结构,是一种哈希树的变种。 典型应用是用于统计,排序和保存大量的字符串(但不仅限于字符串),所以经常被搜索引擎系统用于文本词频统计。 优点:利用字符串的公共前缀来减少查询时间, ...
分类:
其他好文 时间:
2020-03-29 01:29:15
阅读次数:
54
高级树、AVL 树和红黑树 二叉树遍历 Pre order/In order/Post orde 1. 前序(Pre order):根 左 右 2. 中序(In order):左 根 右 3. 后序(Post order):左 右 根 示例代码 二叉搜索树 Binary Search Tree 二叉 ...
分类:
其他好文 时间:
2020-03-29 01:24:53
阅读次数:
83
实现一个 Trie (前缀树),包含 insert, search, 和 startsWith 这三个操作。 示例: Trie trie = new Trie(); trie.insert("apple");trie.search("apple"); // 返回 truetrie.search("a ...
分类:
其他好文 时间:
2020-03-29 01:21:44
阅读次数:
68
什么是数据结构?什么是算法 广义 数据结构:一组数据的存储结构 算法:操作数据的一组方法 例子:图书馆对书籍的分门别类存储=数据结构,查找一本书的方法=算法 狭义 著名的数据结构和算法:队列,栈,堆,二分查找,动态规划 重点:复杂度分析 10个常用的数据结构:数组、链表、栈、队列、散列表、二叉树、堆 ...
分类:
编程语言 时间:
2020-03-29 01:14:09
阅读次数:
70
ini.remove_option Remove a key/value pair from a section in an ini file. Returns the value of the removed key, or if nothing was removed. API Example: ...
分类:
其他好文 时间:
2020-03-28 21:46:58
阅读次数:
70
介绍了Trie树(又称字典树、单词查找树、前缀树)的C++实现和LeetCode上实例。 ...
分类:
编程语言 时间:
2020-03-28 17:54:10
阅读次数:
67