摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4802 【题解】 参考:http://www.matrix67.com/blog/archives/234 Millar-Rabin质数检验方法: 根据费马小定理,如果p是素数,a<p,那么有a 阅读全文
posted @ 2017-05-27 22:03 Galaxies 阅读(1829) 评论(1) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4896 【题解】 隔壁thusc画风怎么这么正常啊。。 三个操作:插入字符串,删除字符串,询问以某字符串为前缀,最早什么时候超过了d个。 用trie插入然后拿个vector维护第一次超过x个的时 阅读全文
posted @ 2017-05-27 15:37 Galaxies 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4760 【题解】 直接dp,f[i][j][k]表示到了第i个,用了j次改变,上一次出k。 直接转移,压下空间。 # include <stdio.h> # include <string.h> 阅读全文
posted @ 2017-05-27 14:50 Galaxies 阅读(333) 评论(0) 推荐(0) 编辑