摘要: 题意 求1到之间所有与n互质的数的四次幂之和。分析 分解n^5-(n-1)^5..可以求出1^4+2^4+...+n^4的公式S(n)=1/30*(n^5+15*n^2*(n+1)^2-10*n*(n+1)*(2*n+1)+15*n*(n+1)-6*n) 先求出S(n),利用容斥原理去掉是n的质因子的倍数的数的四次幂之和。。。 1 #include<iostream> 2 #include<algorithm> 3 #include<cstring> 4 #include<vector> 5 #define N 100100 6 #include 阅读全文
posted @ 2012-10-11 23:15 silver__bullet 阅读(104) 评论(0) 推荐(0) 编辑