随笔分类 -  A-算法-Pollard-Rho

摘要:题意 问有多少个长度为$N$且字符集大小为$K$的字符串可以通过回文串旋转 (把第一个字符移到最后)若干次得到。$K\le N≤10^{18}$ 做法 "ARC64F" 的加强版 设$h(d)=d~is~odd?d:\frac{d}{2}$,$f(d)$为最小周期为$i$的回文串 有$g(d)=K^ 阅读全文
posted @ 2020-02-27 10:30 Grice 阅读(191) 评论(0) 推荐(1)