07 2022 档案

摘要:Trie树 Trie树也叫字典树。 主要是用于多个字符串中与某个字符串的匹配,也是AC自动机的一个基础。 Trie树的好处在于匹配时只需要O(N)算法即可完成,如果使用暴力则需要O(MN),这就是一种优化。 Trie树的实现 一般是利用多个数组来模拟树的链接关系。 为了简单起见,我们只考虑小写字母的 阅读全文
posted @ 2022-07-09 22:06 zhanghanLeo 阅读(80) 评论(0) 推荐(0) 编辑
摘要:https://leetcode.cn/problems/implement-magic-dictionary/ static int son[10010][26]; int idx = 0; static int cnt[10010]; class MagicDictionary { public 阅读全文
posted @ 2022-07-09 11:57 zhanghanLeo 阅读(57) 评论(0) 推荐(0) 编辑
摘要:[LC2300] class Solution { public: using LL = long long; vector<int> successfulPairs(vector<int>& spells, vector<int>& potions, long long success) { // 阅读全文
posted @ 2022-07-03 12:56 zhanghanLeo 阅读(31) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示