hdu 1452 Happy 2004】的更多相关文章

G - Happy 2004 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1452 Description Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to dete…
Happy 2004 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 920    Accepted Submission(s): 648 Problem Description Consider a positive integer X,and let S be the sum of all positive integer divis…
题目链接 题意 : 给你一个X,让你求出2004的X次方的所有因子之和,然后对29取余. 思路 : 原来这就是积性函数,点这里这里这里,这里讲得很详细. 在非数论的领域,积性函数指所有对于任何a,b都有性质f(ab)=f(a)f(b)的函数. 在数论中的积性函数:对于正整数n的一个算术函数 f(n),若f(1)=1,且当a,b互质时f(ab)=f(a)f(b),在数论上就称它为积性函数. 若对于某积性函数 f(n),就算a, b不互质,也有f(ab)=f(a)f(b),则称它为完全积性的. s(…
因子和: 的因子是1,2,3,6; 6的因子和是 s(6)=1+2+3+6=12; 的因子是1,2,4,5,10,20; 20的因子和是 s(20)=1+2+4+5+10+20=42; 的因子是1,2; 2的因子和是 s(2)=1+2=3; 的因子是1,3; 3的因子和是 s(3)=1+3=4; 的因子和是 s(4)=1+2+4=7; 的因子和是 s(5)=1+5=6; s(6)=s(2)*s(3)=3*4=12; s(20)=s(4)*s(5)=7*6=42; 这是巧合吗? 再看 s(50)=…
Problem Description Considera positive integer X,and let S be the sum of all positive integer divisors of2004^X. Your job is to determine S modulo 29 (the rest of the division of S by29). Take X = 1 for an example. The positive integer divisors of 20…
Happy 2004 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2183    Accepted Submission(s): 1582 Problem Description Consider a positive integer X,and let S be the sum of all positive integer di…
题目链接:传送门 题意: 求2004^x的全部约数的和. 分析: 由唯一分解定理可知 x=p1^a1*p2^a2*...*pn^an 那么其约数和 sum = (p1^0+p1^1^-+p1^a1)*-* (pn^0+pn^1^-+pn ) 代码例如以下: #include <iostream> #include <cstring> #include <algorithm> #include <cstdio> using namespace std; con…
Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to determine S modulo 29 (the rest of the division of S by 29). Take X = 1 for an example. The positive integer divisors of 2004^1 are 1, 2, 3,…
让你求$2004^x$所有因子之和,因子之和函数是积性函数$\sigma(n)=\sum_{d|n}d=\prod_{i=0}^{m}(\sum_{j=0}^{k_i}{P_i^{j}})$可用二项式定理证明,然后2004是给定的固定数,然后该怎么求就怎么求 /** @Date : 2017-09-08 18:56:21 * @FileName: HDU 1452 欧拉定理.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmai…
题目链接 hdu 1425 Happy 2004 题解 题目大意: 求 \[\sum_{d|2004^{x}}d\ mod\ 29\] 记为\(s(2004^x)\) \(sum(2004^{x})= s(2^2X)) * s(3^X) * s(167^X)\) $167 mod 29 = 22 $ \(s(2004^X) = s(2^{2X}) * s(3^{X})) * s(22^X)\) 此时底数变为了质数 如果p是素数 \(s(p^n)=1+p+p^2+...+p^n= (p^{n+1}…