• <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>
            #include? < iostream >
            #include?
            < cmath >
            #include?
            < limits >

            struct ?Point
            {
            ????
            int ?x,y;
            }
            ;

            double ?graph[ 201 ][ 201 ];
            Point???data[
            201 ];
            int ?????n;
            bool ????visite[ 201 ];
            double ??result[ 201 ];

            double ?Distance(?Point & ?a,?Point & ?b?)
            {
            ????
            return ?sqrt(?( double )(?(a.x - ?b.x) * ?(a.x - ?b.x?) + ?(a.y - ?b.y?) * ?(a.y - ?b.y?)?)?);
            }


            void ?shortpath(? int ?t?)
            {
            ????
            for ?(? int ?i = ? 1 ;?i <= ?n;? ++ i?)
            ????
            {
            ????????visite[i]
            = ? false ;
            ????????result[i]
            = ? 0.0 ;
            ????}


            ????
            for ?(? int ?i = ? 1 ;?i <= ?n;? ++ i?)
            ????????result[i]
            = ?graph[t][i];

            ????visite[t]
            = ? true ;
            ????
            for ?(? int ?i = ? 1 ;?i <= ?n - ? 1 ;? ++ i?)
            ????
            {
            ????????
            double ?min = ?std::numeric_limits < double > ::max();

            ????????
            int ?k = ? - 1 ;
            ????????
            for ?(? int ?j = ? 1 ;?j <= ?n;? ++ j?)
            ????????????
            if ?(? ! visite[j]? && ?result[j] < ?min?)
            ????????????
            {
            ????????????????min
            = ?result[j];
            ????????????????k
            = ?j;
            ????????????}


            ????????visite[k]
            = ? true ;
            ????????
            for ?(? int ?j = ? 1 ;?j <= ?n;? ++ j?)
            ????????????
            if ?(? ! visite[j]? && ?std::max(?graph[k][j],?result[k]?) < ?result[j]?)
            ????????????????result[j]
            = ?std::max(?graph[k][j],?result[k]?);
            ????}

            }


            int ?main()
            {
            ????
            int ?num = ? 1 ;
            ????
            while (?scanf( " %d " , & n),?n != ? 0 ?)
            ????
            {
            ????????
            for ?(? int ?i = ? 1 ;?i <= ?n;? ++ i?)
            ????????????scanf(
            " %d%d " ,? & data[i].x,? & data[i].y?);

            ????????
            for ?(? int ?i = ? 1 ;?i <= ?n;? ++ i?)
            ????????????
            for ?(? int ?j = ? 1 ;?j <= ?n;? ++ j?)
            ????????????????graph[i][j]
            = ?Distance(?data[i],?data[j]?);

            ????????shortpath(
            1 );
            ????????printf(
            " Scenario?#%d\n " ,?num ++ ?);
            ????????printf(
            " Frog?Distance?=?%.3lf\n " ,?result[ 2 ]?);
            ????????printf(
            " \n " );
            ????}


            ????
            return ? 0 ;
            }
            posted on 2008-10-02 15:24 Darren 閱讀(253) 評論(0)  編輯 收藏 引用 所屬分類: 圖論
            美女久久久久久| 精品久久777| 亚洲AV无码久久精品成人| 国产精品久久久亚洲| 伊人丁香狠狠色综合久久| 亚洲精品无码久久久| 久久精品国产亚洲AV高清热| 久久伊人亚洲AV无码网站| 日产精品久久久久久久| 狠狠综合久久综合中文88| 奇米影视7777久久精品| 久久人人爽人人爽AV片| 99久久婷婷国产一区二区| 色欲久久久天天天综合网| 热综合一本伊人久久精品| 久久精品人人做人人爽电影| 一本色道久久HEZYO无码| 亚洲欧美久久久久9999| 久久综合久久综合久久| 久久久国产乱子伦精品作者| 无码人妻久久一区二区三区蜜桃 | 久久久久久国产精品免费无码| 国产一区二区三精品久久久无广告 | 精品久久久久久中文字幕人妻最新| 久久久精品日本一区二区三区 | 99精品国产在热久久无毒不卡| 久久久久免费精品国产| 香蕉99久久国产综合精品宅男自| 99久久精品费精品国产| 国产日韩欧美久久| 久久国产福利免费| 久久久久久亚洲精品不卡| 久久99精品国产麻豆不卡| 久久久久久久亚洲精品| 亚洲国产香蕉人人爽成AV片久久 | 国产高清美女一级a毛片久久w| 久久久久国产精品| 久久性精品| 亚洲午夜久久久久妓女影院| 欧美丰满熟妇BBB久久久| 久久99免费视频|