05 2023 档案

摘要:题目链接: https://ac.nowcoder.com/acm/contest/59275#rank *** A. 枚举不讲 B. 简单二分不讲 C. 暴力是O(n2)的, 用KMP可以直接做到O(n), 贴一下代码 ``` /* Author: SJ */ #include cons 阅读全文
posted @ 2023-05-30 11:21 IHOPEIDIEYOUNG 阅读(9) 评论(0) 推荐(0) 编辑
摘要:资料内容: https://oi-wiki.org/string/kmp/ *** 很久以前学过,写一些笔记作复习资料 一些概念: 真前缀, 真后缀等等不作介绍 (**真前后缀匹配函数**)前缀函数(pi函数): $$ \pi[i] = \max_{k = 0 \dots i}\{k: s[0 \d 阅读全文
posted @ 2023-05-30 11:04 IHOPEIDIEYOUNG 阅读(74) 评论(0) 推荐(0) 编辑
摘要:快速求12+22+32++n2模11的余数 *** 我们来证明一下12+22+32++n2的通项公式是n(n+1)(2n+1)6, 然后就可以O(1)直接算这个式子: Lemma 1: 对于任意 阅读全文
posted @ 2023-05-24 04:30 IHOPEIDIEYOUNG 阅读(13) 评论(0) 推荐(0) 编辑
摘要:题目链接: A https://www.luogu.com.cn/problem/P5831 B https://www.luogu.com.cn/problem/P5832 C https://www.luogu.com.cn/problem/P5832 A 分析: 范围很小, 直接暴力枚举即可, 阅读全文
posted @ 2023-05-15 02:19 IHOPEIDIEYOUNG 阅读(14) 评论(0) 推荐(0) 编辑

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