摘要: SPFA 算法是 Bellman-Ford算法 的队列优化算法的别称,通常用于求含负权边的单源最短路径,以及判负权环。SPFA 最坏情况下复杂度和朴素 Bellman-Ford 相同,为 O(VE)。 判断负权边:其实就是多加一个 cnt[] 数组 最短路径:inq[] 防止重复访问 上面使用vec 阅读全文
posted @ 2019-08-03 16:32 _Ackerman 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 1258 - Making Huge Palindromes PDF (English) Statistics ForumTime Limit: 1 second(s) Memory Limit: 32 MBA string is said to be a palindrome if it rema 阅读全文
posted @ 2019-08-03 15:15 _Ackerman 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 1258 - Making Huge Palindromes PDF (English) Statistics ForumTime Limit: 1 second(s) Memory Limit: 32 MBA string is said to be a palindrome if it rema 阅读全文
posted @ 2019-08-03 15:09 _Ackerman 阅读(202) 评论(0) 推荐(0) 编辑
摘要: AC自动机不是自动AC机 简介 看dalao们AC自动机的Blog,大多数奆奆都会感性地说: AC_automation = KMP+TRIE 然而在我重蹈覆辙辗转反侧n次后才明白,这东西说了等于没说。 AC自动机是一种有限状态自动机(说了等于没说),它常被用于多模式串的字符串匹配。 在学完AC自动 阅读全文
posted @ 2019-08-03 00:17 _Ackerman 阅读(232) 评论(0) 推荐(0) 编辑