• <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
            <2025年6月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            293012345

            常用鏈接

            留言簿(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;

            }


             

             

             

            99久久精品免费国产大片| 欧美麻豆久久久久久中文| 久久这里有精品| 久久av无码专区亚洲av桃花岛| 久久久久亚洲AV成人网人人网站| 久久亚洲AV成人无码| 品成人欧美大片久久国产欧美 | 九九热久久免费视频| 久久综合给合久久狠狠狠97色69| 久久人妻少妇嫩草AV无码蜜桃| 久久大香萑太香蕉av| 亚洲狠狠久久综合一区77777| 一级a性色生活片久久无少妇一级婬片免费放| 欧美午夜精品久久久久免费视| 久久99久久99小草精品免视看| 久久久免费精品re6| 久久精品国产精品亜洲毛片| 99久久人人爽亚洲精品美女| 精品久久久久久久国产潘金莲| 国产成人精品久久免费动漫| 69久久夜色精品国产69| 深夜久久AAAAA级毛片免费看| 久久99精品久久久久久| 无遮挡粉嫩小泬久久久久久久| 久久亚洲私人国产精品| 亚洲第一永久AV网站久久精品男人的天堂AV | 精品久久久久久久中文字幕| 久久久精品久久久久影院| 久久久WWW成人免费精品| 热久久国产精品| 大美女久久久久久j久久| 色8久久人人97超碰香蕉987| 无码人妻久久一区二区三区蜜桃| 久久国产精品国语对白| 久久精品女人天堂AV麻| 久久久久亚洲av成人无码电影| 狠狠精品干练久久久无码中文字幕 | 五月丁香综合激情六月久久| 久久综合久久自在自线精品自| 亚洲狠狠婷婷综合久久蜜芽| 精品熟女少妇AV免费久久|