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

            午夜天堂精品久久久久| 久久久无码精品亚洲日韩蜜臀浪潮| 一本综合久久国产二区| 精品久久久久成人码免费动漫 | 久久国产福利免费| 亚洲乱码日产精品a级毛片久久| 欧美久久综合九色综合| 久久人人爽爽爽人久久久| 国产精品美女久久久久AV福利| 一日本道伊人久久综合影| 无码伊人66久久大杳蕉网站谷歌| 国产精品99久久久久久猫咪 | 99久久无码一区人妻a黑| 99久久免费国产精品| 日韩人妻无码一区二区三区久久99| 午夜不卡久久精品无码免费| 天堂无码久久综合东京热| 亚洲乱亚洲乱淫久久| 久久综合给合久久狠狠狠97色69| 久久久99精品一区二区| 色综合久久综合网观看| 五月丁香综合激情六月久久 | 狠狠色丁香婷婷综合久久来来去| 久久久噜噜噜久久中文字幕色伊伊| 久久99国产精品久久99果冻传媒 | 久久精品免费全国观看国产| 亚洲国产成人久久综合区| 精品久久久久久无码人妻热| 久久久综合九色合综国产| 久久九九精品99国产精品| 中文字幕久久波多野结衣av| 色天使久久综合网天天| 久久久久亚洲AV片无码下载蜜桃 | 国产午夜免费高清久久影院| 国产69精品久久久久APP下载| 久久久久成人精品无码| 久久久综合香蕉尹人综合网| 久久久精品日本一区二区三区| 国产高潮国产高潮久久久91| 欧美久久久久久精选9999| 中文成人久久久久影院免费观看|