• <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>

            ACM___________________________

            ______________白白の屋
            posts - 182, comments - 102, trackbacks - 0, articles - 0
            <2010年9月>
            2930311234
            567891011
            12131415161718
            19202122232425
            262728293012
            3456789

            常用鏈接

            留言簿(24)

            隨筆分類(332)

            隨筆檔案(182)

            FRIENDS

            搜索

            積分與排名

            最新隨筆

            最新評論

            閱讀排行榜

            評論排行榜

            MiYu原創(chuàng), 轉(zhuǎn)帖請注明 : 轉(zhuǎn)載自 ______________白白の屋    

             

            題目地址 :
                http://acm.hdu.edu.cn/showproblem.php?pid=1017

            題目描述:

            A Mathematical Curiosity

            Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
            Total Submission(s): 8614    Accepted Submission(s): 2592


            Problem Description
            Given two integers n and m, count the number of pairs of integers (a,b) such that 0 < a < b < n and (a^2+b^2 +m)/(ab) is an integer.

            This problem contains multiple test cases!

            The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks.

            The output format consists of N output blocks. There is a blank line between output blocks.
             

            Input
            You will be given a number of cases in the input. Each case is specified by a line containing the integers n and m. The end of input is indicated by a case in which n = m = 0. You may assume that 0 < n <= 100.
             

            Output
            For each case, print the case number as well as the number of pairs (a,b) satisfying the given property. Print the output for each case on one line in the format as shown below.
             

            Sample Input
            1 10 1 20 3 30 4 0 0
             

            Sample Output
            Case 1: 2 Case 2: 4 Case 3: 5
             

             

             題目分析 :

              沒事水一水, 嘿嘿.......   新手只需要 注意下輸出就可以了 . 暴力過, 沒什么技巧

             

            代碼如下 :

             /*

            MiYu原創(chuàng), 轉(zhuǎn)帖請注明 : 轉(zhuǎn)載自 ______________白白の屋

                      http://www.cnblog.com/MiYu

            Author By : MiYu

            Test      : 1

            Program   : 1017

            */


            #include <iostream>

            #include <algorithm>

            using namespace std;

            int main ()

            {

                int T;    cin >> T;

                for ( int k = 1; k <= T; ++ k ){

                       int N, M, ca = 1, cnt = 0;

                       if ( k != 1 ) putchar ( 10 );

                       while ( cin >> N >> M, N || M ){     cnt = 0;

                              for ( int i = 1; i < N; ++ i ){

                                   for ( int j = i + 1; j < N; ++ j ){

                                        if ( ( i * i + j * j + M ) % ( i * j ) == 0 )    

                                             cnt ++;

                                   }    

                              }   

                              printf ( "Case %d: %d\n",ca++, cnt );   

                       }      

                } 

                return 0;

            }


             

             

             

            久久久久久久波多野结衣高潮| 97精品国产97久久久久久免费| 国产99久久久久久免费看| 亚洲va久久久噜噜噜久久| 久久亚洲色一区二区三区| 91精品国产91热久久久久福利| 亚洲综合熟女久久久30p| 久久午夜无码鲁丝片秋霞| 久久丫精品国产亚洲av| 久久久黄色大片| 香港aa三级久久三级老师2021国产三级精品三级在 | 久久亚洲精品视频| 久久被窝电影亚洲爽爽爽| 一本久久a久久精品综合夜夜| 国产精品丝袜久久久久久不卡| 国产精品久久久久无码av| 久久精品国产只有精品2020| 久久线看观看精品香蕉国产| 青青草国产精品久久久久| 久久国产视屏| 亚洲AV无码久久精品狠狠爱浪潮| 久久亚洲精品中文字幕| 99久久人人爽亚洲精品美女| 午夜视频久久久久一区| 色偷偷88888欧美精品久久久| 九九99精品久久久久久| 无码任你躁久久久久久久| 亚洲欧美伊人久久综合一区二区| 丰满少妇人妻久久久久久| 久久99亚洲综合精品首页| 久久久这里有精品| 精品久久久久久国产| 人妻精品久久久久中文字幕 | 久久99精品久久久大学生| 久久夜色精品国产亚洲| 区亚洲欧美一级久久精品亚洲精品成人网久久久久| 亚洲国产成人久久综合野外| 久久久久久久99精品免费观看| 色综合久久久久综合99| 久久国产高清字幕中文| 久久综合久久美利坚合众国|