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

            coreBugZJ

            此 blog 已棄。

            How Long Is it, FZU 2011年3月月賽之 G, FZU 2016

            Problem 2016 How Long Is it

            Time Limit: 1000 mSec    Memory Limit : 32768 KB

            Problem Description

            You are given two points in earth. (Points are described as the latitude (between -90 and +90 degrees) and longitude (between -180 and +180 degrees)) You are expected to calculate the distance between them ( in km). In this problem the radius of earth is 6378 km.

            Input

            In the first line one integer T indicates the number of test cases. (T <= 1000)

            For each case, only two points each giving the latitude (between -90 and +90 degrees) and longitude (between -180 and +180 degrees) .

            Output

            For each test case, output the distance between them, the answer should accurate to 0.01.

            Sample Input

            4
            -90 180 -90 90
            -90 180 -90 90
            -90 0 -90 90
            -90 0 90 90

            Sample Output

            0.00
            0.00
            0.00
            20037.08

            Source

            FOJ有獎月賽-2011年03月

            水題。。。

             1 #include <iostream>
             2 #include <cstdio>
             3 #include <cmath>
             4 
             5 using namespace std;
             6 
             7 const double PI = 3.141592653589793;
             8 const double R = 6378;
             9 
            10 #define  A(x)  ( (x) * PI / 180.0 )
            11 
            12 int main() {
            13         int td, a, b, c, d;
            14         double da, db, dc, dd, px, py, pz, qx, qy, qz, ang, dist;
            15         scanf( "%d"&td );
            16         while ( td-- > 0 ) {
            17                 scanf( "%d%d%d%d"&a, &b, &c, &d );
            18                 da = A(a);
            19                 db = A(b);
            20                 dc = A(c);
            21                 dd = A(d);
            22 
            23                 pz = R * sin( da );
            24                 qz = R * sin( dc );
            25 
            26                 px = R * cos( da ) * cos( db );
            27                 qx = R * cos( dc ) * cos( dd );
            28 
            29                 py = R * cos( da ) * sin( db );
            30                 qy = R * cos( dc ) * sin( dd );
            31 
            32                 ang = acos( (px*qx+py*qy+pz*qz) / 
            33                                 sqrt(px*px+py*py+pz*pz) / 
            34                                 sqrt(qx*qx+qy*qy+qz*qz)    );
            35                 dist = R * ang;
            36 
            37                 printf( "%0.2lf\n", dist );
            38         }
            39         return 0;
            40 }
            41 


            posted on 2011-03-20 20:49 coreBugZJ 閱讀(1360) 評論(0)  編輯 收藏 引用 所屬分類: ACM

            午夜精品久久久久久久久| 久久久国产打桩机| 久久香蕉超碰97国产精品| 久久久久免费看成人影片| 久久精品aⅴ无码中文字字幕重口| 久久A级毛片免费观看| 久久精品国产久精国产| 欧美国产精品久久高清| 亚洲精品无码久久久久去q| 久久96国产精品久久久| 久久久久亚洲AV无码专区桃色| 久久这里只精品99re66| 亚洲乱码精品久久久久.. | 伊人色综合久久天天| 久久一区二区免费播放| 精品永久久福利一区二区| 亚洲色欲久久久久综合网| 国产精品久久久久aaaa| 狠狠色丁香婷婷综合久久来来去| 亚洲综合伊人久久综合| 久久久综合香蕉尹人综合网| 无码精品久久久天天影视| 热RE99久久精品国产66热| 国产亚洲欧美成人久久片| 久久人人爽爽爽人久久久| 亚洲伊人久久成综合人影院 | 狠狠色婷婷久久一区二区| 国产精品青草久久久久福利99| 亚洲女久久久噜噜噜熟女| 日本久久久久久久久久| 午夜不卡888久久| 色综合久久综精品| 久久国产精品77777| 久久亚洲精品中文字幕| 99久久精品免费看国产一区二区三区 | 久久精品国产99国产电影网| 久久久国产精品亚洲一区| 久久久精品国产sm调教网站| 久久精品中文闷骚内射| 国产高潮国产高潮久久久| 久久久免费精品re6|