• <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年8月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234

            常用鏈接

            留言簿(24)

            隨筆分類(332)

            隨筆檔案(182)

            FRIENDS

            搜索

            積分與排名

            最新隨筆

            最新評論

            閱讀排行榜

            評論排行榜

            MiYu原創, 轉帖請注明 : 轉載自 ______________白白の屋    

             

            題目地址 :
                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原創, 轉帖請注明 : 轉載自 ______________白白の屋

                      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;

            }


             

             

             

            精品熟女少妇av免费久久| 久久91精品国产91久| 久久亚洲中文字幕精品一区四 | 狠狠久久亚洲欧美专区 | 精品久久人人爽天天玩人人妻| 色综合久久综合中文综合网| 精品久久久久久久| 亚洲午夜久久久| 精品熟女少妇av免费久久| 久久99精品久久久久久9蜜桃| 久久精品免费全国观看国产| 精品久久久久久国产91| 婷婷五月深深久久精品| 一本久久免费视频| 国产女人aaa级久久久级| 久久精品国产亚洲AV麻豆网站 | 99久久综合狠狠综合久久| 热99RE久久精品这里都是精品免费| 日本福利片国产午夜久久| 亚洲∧v久久久无码精品| 久久久久久午夜精品| 理论片午午伦夜理片久久| 99久久99久久精品国产片| 精品精品国产自在久久高清| 亚洲精品视频久久久| 色婷婷久久综合中文久久一本| 91精品国产综合久久四虎久久无码一级| 久久精品欧美日韩精品| 婷婷久久香蕉五月综合加勒比| 亚洲中文字幕无码久久2020| 亚洲国产精品无码久久久久久曰| 99热都是精品久久久久久| 久久精品视频网| 91久久精品无码一区二区毛片| 精品免费tv久久久久久久| 丁香五月网久久综合| 99热都是精品久久久久久| 久久免费国产精品| 欧美亚洲国产精品久久久久| 久久精品国产男包| 久久香蕉一级毛片|