随笔分类 - 字符串
摘要:题目链接:https://www.luogu.org/problemnew/show/P1666 10.13考试题 当时没想出来,觉得是要用trie做,在trie上跑一个树形dp 结果是写了个子集枚举还炸了 后来这道题可以暴力+string类型解 还是string用的少啊 include inclu
阅读全文
摘要:题目链接:https://www.luogu.org/problemnew/show/P3808 include include include include include using namespace std; const int maxn = 1000010; int n, trie[ma
阅读全文
摘要:题目链接:https://www.luogu.org/problemnew/show/P3375 精华:在每次失配后不从头匹配而是尝试找一个新的开始并且是新开始的位置最长的相同前缀和后缀。 实际上KMP是一种自己匹配自己的模式。好好理解qaq include include include incl
阅读全文
摘要:题目链接:https://www.luogu.org/problemnew/show/P3879 我先说一句: 我永远都喜欢~~Stella~~STL _______ 这个题,很明显就是 ~~trie树~~ ~~hash~~ map+vector _______ 思路: 直接用map 代替这题里的t
阅读全文
摘要:题目链接:https://www.luogu.org/problemnew/show/P2580 我真的永远都爱stl 后来我发现,trie也很棒棒哦qaq
阅读全文
摘要:题目链接:https://www.luogu.org/problemnew/show/P4711 要细心模拟 include include include include include using namespace std; char s[10001]; int k; double nans1
阅读全文
摘要:对于2017 D1 T2 这道题 实实在在是个码力题,非常考验耐心。 其实大体的思路并不是非常难想出来,但是要注意的小细节比较多。 题目链接:https://www.luogu.org/problemnew/show/P3952 思路 对于每一个程序,先读入L和O(),并将其中的时间复杂度抠出来。
阅读全文
摘要:题目链接:https://www.luogu.org/problemnew/show/P1307 刚入门的一道字符串模拟,分四种情况讨论来做比较好。
阅读全文

浙公网安备 33010602011771号