2015年12月14日

hdu 2824The Euler function

摘要: 题目链接 快速求出a到b之间所有数的欧拉函数。 一个一个求肯定是不行的, 我们知道欧拉函数的公式为phi(n) = n*(1-1/i1)*(1-1/i2).......i1, i2为素因子。 那么我们就可以先将每一个数的欧拉函数值预处理出来。 具体看代码 1 #include<bits/stdc++ 阅读全文

posted @ 2015-12-14 14:17 yohaha 阅读(117) 评论(0) 推荐(0) 编辑

codeforces 535D. Tavas and Malekas KMP

摘要: 题目链接又复习了一遍kmp....之前都忘光了 1 #include 2 using namespace std; 3 #define pb(x) push_back(x) 4 #define ll long long 5 #define mk(x, y) make_pair(x, y) 6 #de... 阅读全文

posted @ 2015-12-14 10:11 yohaha 阅读(368) 评论(0) 推荐(0) 编辑

导航