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

            国产成人精品久久| 偷偷做久久久久网站| 久久影院综合精品| 久久国产一区二区| 亚洲国产综合久久天堂| 久久久久国产精品人妻| 麻豆AV一区二区三区久久| 99久久精品免费看国产一区二区三区| 久久99精品久久久久久不卡| 无码AV中文字幕久久专区| 99久久国产免费福利| 日日躁夜夜躁狠狠久久AV| 93精91精品国产综合久久香蕉| 久久午夜夜伦鲁鲁片免费无码影视 | 亚洲乱码精品久久久久..| 久久不射电影网| 人妻无码αv中文字幕久久琪琪布| 久久精品aⅴ无码中文字字幕重口 久久精品a亚洲国产v高清不卡 | 色噜噜狠狠先锋影音久久| 久久综合亚洲色HEZYO社区 | 亚洲狠狠婷婷综合久久蜜芽| 精品99久久aaa一级毛片| 婷婷伊人久久大香线蕉AV| 国产日韩久久久精品影院首页| 无码人妻久久一区二区三区免费丨 | 99久久人妻无码精品系列蜜桃| 亚洲国产精品嫩草影院久久| 99国内精品久久久久久久| 亚洲国产另类久久久精品| 久久人妻少妇嫩草AV蜜桃| 久久综合狠狠综合久久97色| 国产精品99久久久久久猫咪| 久久久久亚洲AV无码麻豆| 午夜精品久久久久久久久| 久久久久久精品久久久久| 亚洲精品国产综合久久一线| 久久久久久毛片免费看| 国产精品欧美久久久久天天影视 | 久久久久久久综合狠狠综合| 中文国产成人精品久久亚洲精品AⅤ无码精品 | 亚洲精品乱码久久久久久按摩 |