• <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
            數據加載中……

            2008 Hangzhou 網絡賽-D hdu2421 (數論)

            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.

            讀不懂題意就是傻逼啊!!!!!!!
            這個題目是要求每個因子的因子的個數然后再立方和啊啊啊啊
            8的因子有1 2 4 8,它們的因子數有1 2 3 4啊,立方和為1+8+27+64=100啊。
            轉化為算術基本定理:
            N=A^B
            求N的每個因子的因子數:
                  任何一個大于1的數可以分解成 N=a1^p1*a2^p2*a3^p3*...*an^pn, N的約數總數為(p1+1)*(p2+1)*...*(pn+1),
                  (0,1,...,p1)(0,1,...,p2)...(0,1,...,pn)
                   不難發現(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 閱讀(224) 評論(0)  編輯 收藏 引用 所屬分類: ACM-數學

            久久成人小视频| 久久九九有精品国产23百花影院| 精品免费久久久久国产一区| 99久久国产免费福利| 韩国三级中文字幕hd久久精品 | 久久午夜综合久久| 日韩欧美亚洲综合久久| 7777久久亚洲中文字幕| 久久这里只有精品首页| 亚洲国产精品无码久久青草 | 久久se精品一区二区| 久久精品这里只有精99品| 蜜桃麻豆WWW久久囤产精品| 国产精品美女久久久| 久久99免费视频| 99精品久久精品一区二区| 97精品伊人久久大香线蕉app | 韩国无遮挡三级久久| 日本亚洲色大成网站WWW久久 | 99久久精品免费看国产| 一本一本久久aa综合精品 | 色偷偷久久一区二区三区| 九九久久精品国产| 久久水蜜桃亚洲av无码精品麻豆| 久久精品国产亚洲Aⅴ香蕉 | 久久综合噜噜激激的五月天| 久久精品国产亚洲AV不卡| 99久久久精品免费观看国产| 亚洲国产成人久久综合区| 夜夜亚洲天天久久| 久久不见久久见免费视频7| 国内精品久久久久久久久电影网 | 久久精品国产亚洲沈樵| 无码人妻久久一区二区三区免费丨 | 久久精品中文字幕一区| 伊人热人久久中文字幕| 久久精品无码午夜福利理论片 | 亚洲国产美女精品久久久久∴ | 精品免费tv久久久久久久| 久久影院综合精品| 久久水蜜桃亚洲av无码精品麻豆|