• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            ArcTan

            dfs
            隨筆 - 16, 文章 - 117, 評論 - 6, 引用 - 0
            數(shù)據(jù)加載中……

            2008 Hangzhou 網(wǎng)絡(luò)賽-D hdu2421 (數(shù)論)

            Problem Description:
            Xiaoming has just come up with a new way for encryption, by calculating the key from a publicly viewable number in the following way:
            Let the public key N = AB, where 1 <= A, B <= 1000000, and a0, a1, a2, …, ak-1 be the factors of N, then the private key M is calculated by summing the cube of number of factors of all ais. For example, if A is 2 and B is 3, then N = AB = 8, a0 = 1, a1 = 2, a2 = 4, a3 = 8, so the value of M is 1 + 8 + 27 + 64 = 100.
            However, contrary to what Xiaoming believes, this encryption scheme is extremely vulnerable. Can you write a program to prove it?

            Input
            There are multiple test cases in the input file. Each test case starts with two integers A, and B. (1 <= A, B <= 1000000). Input ends with End-of-File.
            Note: There are about 50000 test cases in the input file. Please optimize your algorithm to ensure that it can finish within the given time limit.
            Output
            For each test case, output the value of M (mod 10007) in the format as indicated in the sample output.
             

            summing the cube of number of factors of all ais.
            summing the cube of number of factors of all ais.
            summing the cube of number of factors of all ais.
            summing the cube of number of factors of all ais.
            summing the cube of number of factors of all ais.
            summing the cube of number of factors of all ais.
            summing the cube of number of factors of all ais.
            summing the cube of number of factors of all ais.
            summing the cube of number of factors of all ais.

            讀不懂題意就是傻逼啊!!!!!!!
            這個題目是要求每個因子的因子的個數(shù)然后再立方和啊啊啊啊
            8的因子有1 2 4 8,它們的因子數(shù)有1 2 3 4啊,立方和為1+8+27+64=100啊。
            轉(zhuǎn)化為算術(shù)基本定理:
            N=A^B
            求N的每個因子的因子數(shù):
                  任何一個大于1的數(shù)可以分解成 N=a1^p1*a2^p2*a3^p3*...*an^pn, N的約數(shù)總數(shù)為(p1+1)*(p2+1)*...*(pn+1),
                  (0,1,...,p1)(0,1,...,p2)...(0,1,...,pn)
                   不難發(fā)現(xiàn)(1^3+2^3+...+(p1+1)^3) (1^3+2^3+...+(p2+1)^3)...(1^3+2^3+...+(pn+1)^3)即為所求。


            #include<stdio.h>
            #include
            <string.h>
            #include
            <math.h>
            #define maxn 1000005
            int p[1015];
            int  b[1015];
            int tot;

            int eular()
            {
                memset(b,
            0,sizeof(b));
                
            int i=2;tot=0;
                
            while (i<1010)
                {
                    
            while (b[i])    i++;
                    p[tot
            ++]=i;
                    
            int j=i;
                    
            while (j<1010)
                    {
                        b[j]
            =1;
                        j
            +=i;
                    }
                }
                tot
            --;
                
            return 0;
            }

            int main()
            {
                
            long long A,B;
                
            int t=0;
                eular();
                
            while (scanf("%I64d%I64d",&A,&B)==2)
                {
                    printf(
            "Case %d: ",++t);
                    B
            %=10007;
                    
            long long ans=1;
                    
            long long t,tt;
                    
            int i=0;
                    
            while (i<tot && A>1)
                    {
                        t
            =0;
                        
            while (A%p[i]==0)
                            t
            ++,A/=p[i];
                        tt
            =(t*B+1)*(t*B+2)/2 % 10007;
                        tt
            =tt*tt % 10007;
                        ans
            =(ans*tt) % 10007;
                        i
            ++;
                    }
                    
            if (A>1)
                    {
                        tt
            =(B+1)*(B+2)/2 % 10007;
                        tt
            =tt*tt % 10007;
                        ans
            =(ans*tt)%10007;
                    }
                    printf(
            "%I64d\n",ans);
                }
                
            return 0;
            }




            posted on 2012-07-19 15:09 wangs 閱讀(223) 評論(0)  編輯 收藏 引用 所屬分類: ACM-數(shù)學(xué)

            国产真实乱对白精彩久久| 久久久久成人精品无码| 久久久久久免费视频| 亚洲国产成人精品女人久久久| 久久久久国产视频电影| 亚洲国产精品无码久久一线| 99久久er这里只有精品18| 久久国产精品免费| 人妻无码中文久久久久专区 | 日本免费一区二区久久人人澡| 国产精品成人无码久久久久久| 亚洲日本va中文字幕久久| 97超级碰碰碰碰久久久久| 亚洲精品乱码久久久久久中文字幕 | 久久精品国产72国产精福利| 无码精品久久久天天影视| 久久强奷乱码老熟女网站| 91精品国产乱码久久久久久| 久久天天躁夜夜躁狠狠躁2022| 久久国产精品成人免费| 77777亚洲午夜久久多喷| 欧美激情精品久久久久久久九九九 | 精品久久久无码人妻中文字幕| 久久e热在这里只有国产中文精品99 | 久久受www免费人成_看片中文 | 久久久久亚洲爆乳少妇无| av国内精品久久久久影院| 久久99热这里只有精品国产| 久久伊人中文无码| 狠狠色综合久久久久尤物| 久久综合综合久久97色| 精品无码久久久久久尤物| 蜜臀av性久久久久蜜臀aⅴ麻豆| 久久夜色精品国产噜噜亚洲a| 久久久久成人精品无码| 免费一级欧美大片久久网 | 久久人人爽人人爽AV片| 久久久无码精品午夜| 日韩久久无码免费毛片软件| 久久亚洲高清综合| 久久久久se色偷偷亚洲精品av|