摘要: #include using namespace std;const int N=1000005;int P, cnt, pcnt, p[N], pr[N];bool np[N];typedef long long ll;int gcd(int a, int b) { return b?gcd(b,... 阅读全文
posted @ 2015-03-19 20:58 iwtwiioi 阅读(1597) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1284题意:求一个素数p的原根个数。(p#include #include #include #include using namespace std;const int lim=65535, N=70005;int p[N], pcnt, np... 阅读全文
posted @ 2015-03-19 20:07 iwtwiioi 阅读(240) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=2084题意:一个01串,求满足字符串0和1取反后,再将整个串反过来和原串一样的子串数目。(nusing namespace std;const int N=500005;long long ans;in... 阅读全文
posted @ 2015-03-19 16:15 iwtwiioi 阅读(298) 评论(1) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3974题意:求s的最长回文串。(|s|#include #include #include #include using namespace std;char s[2000050]; int len[2000050], T;int main() ... 阅读全文
posted @ 2015-03-19 14:21 iwtwiioi 阅读(381) 评论(0) 推荐(0) 编辑