摘要: 只会打表#include #include #include #include using namespace std;int main(){int Mec[10] = { 11, 23, 29, 37, 41, 43, 47, 53, 59 }; char st[10][100] = ... 阅读全文
posted @ 2014-08-28 15:46 chenjunjie1994 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 一道好题。由算术基本定理,知:那么,对于上式的每个因子值只能是2^M的形式。取第一个式子为例,通过分解因式出(1+p^2)=2^k知,a只能为1.于是对于p只能是梅森素数。而且每个梅森素数只能出现一次,利用这个就可以求解了,#include #include #include #include us... 阅读全文
posted @ 2014-08-28 14:35 chenjunjie1994 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 和上一题一样,注意除不尽为0#include #include #include #include using namespace std;long long n,p;int main(){ int t; scanf("%d",&t); while(t--){ scanf("%lld%lld",&... 阅读全文
posted @ 2014-08-28 09:46 chenjunjie1994 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 其实一道公式题:n!中素数i的幂为:[n/i]+[n/i^2]+[n/i^3]+[n/i^4]+......#include #include #include using namespace std;long long n;int main(){ long long two,five; int t... 阅读全文
posted @ 2014-08-28 09:19 chenjunjie1994 阅读(122) 评论(0) 推荐(0) 编辑