• <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有獎(jiǎng)月賽-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) 評(píng)論(0)  編輯 收藏 引用 所屬分類: ACM

            久久久亚洲裙底偷窥综合| 亚洲国产精品一区二区久久hs| 精品熟女少妇a∨免费久久| 国内精品人妻无码久久久影院 | 91久久九九无码成人网站| 97精品伊人久久大香线蕉app| 久久青草国产精品一区| 久久亚洲国产精品123区| 久久婷婷五月综合成人D啪| 国内精品久久久久久久97牛牛| 久久这里只有精品久久| 亚洲va久久久久| 久久国产精品久久国产精品| 久久人妻少妇嫩草AV蜜桃| 99久久无色码中文字幕| 久久国产AVJUST麻豆| 97久久综合精品久久久综合| 伊人久久亚洲综合影院| 久久线看观看精品香蕉国产| 国内精品伊人久久久影院| 亚洲综合精品香蕉久久网97| 2021最新久久久视精品爱| 狠狠综合久久综合中文88| 久久精品人人做人人爽97 | 99久久婷婷免费国产综合精品| 日批日出水久久亚洲精品tv| 成人精品一区二区久久| 国产精品久久久久久福利69堂| 国内精品九九久久精品| 久久这里的只有是精品23| 久久国产精品波多野结衣AV | 精品国产VA久久久久久久冰 | 国产午夜福利精品久久2021| 久久精品国产欧美日韩99热| 欧美久久天天综合香蕉伊| 久久久噜噜噜久久| 欧美久久天天综合香蕉伊| 久久久久久无码国产精品中文字幕| 久久这里只有精品首页| 91麻精品国产91久久久久 | 中文字幕久久波多野结衣av|