笔记
感觉自己就是个bug
这个作者很懒,什么都没留下…
展开
-
KMP算法模板
//具体思想就那样,从1开始, nextval[1] = 0 略略略 int Index_KMP(String S, String T, int next[]){ int i = 1, j = 0; while (i < T.length) { if (j == 0 || T.ch[i] == S.ch[j]) { ++i; ++j; if (T.ch[i] != T.ch[j]) nextval[i] = j; else nextval[i] = nextval[j];原创 2021-06-30 20:25:22 · 105 阅读 · 1 评论 -
PAT(甲级)2019年秋季考试7-1 Forever (20 分)
7-1 Forever (20 分) “Forever number” is a positive integer A with K digits, satisfying the following constrains: the sum of all the digits of A is m; the sum of all the digits of A+1 is n; and the greatest common divisor of m and n is a prime number which i原创 2021-03-11 00:55:15 · 196 阅读 · 1 评论