• <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 閱讀(1355) 評論(0)  編輯 收藏 引用 所屬分類: ACM

            久久久久亚洲爆乳少妇无 | 久久久久久国产a免费观看黄色大片 | 亚洲精品WWW久久久久久| 成人资源影音先锋久久资源网| 久久这里的只有是精品23| 精品欧美一区二区三区久久久| 欧美伊香蕉久久综合类网站| 久久久国产精品亚洲一区| 蜜桃麻豆WWW久久囤产精品| 一本久久a久久精品综合香蕉| 精品久久人人做人人爽综合| 国内精品免费久久影院| 93精91精品国产综合久久香蕉| 国产精品99久久99久久久| 久久精品国产亚洲av麻豆色欲| 精品国产乱码久久久久久郑州公司| 亚洲精品tv久久久久久久久 | 午夜天堂av天堂久久久| 亚洲精品无码专区久久久| www久久久天天com| 天天爽天天爽天天片a久久网| 国产69精品久久久久9999| 久久久久久久综合日本| 亚洲色欲久久久久综合网| 久久亚洲国产最新网站| 久久人爽人人爽人人片AV| 狠狠色丁香久久婷婷综合五月| 国产亚洲欧美成人久久片| 国产成人综合久久久久久| 人人狠狠综合88综合久久| 久久亚洲AV成人无码软件| 国产人久久人人人人爽| 久久精品国产精品亜洲毛片| 亚洲午夜福利精品久久| 久久成人国产精品| 久久久久亚洲?V成人无码| 亚洲人成精品久久久久| 99久久国产综合精品麻豆| 久久亚洲电影| 91精品国产高清久久久久久io| 久久不见久久见免费影院www日本|