1341. Device

Time limit: 1.0 second
Memory limit: 64 MB
Major (M): You claimed that your device would be able to fly round the Earth several times and to miss not more than a couple of centimeters?
Designer (D); Yes! Our gravitational fields system of navigation absolutely...
M: Furthermore it can’t be fixed by detectors and doesn’t have a receiver or transmitter.
Engineer (E): It was your demand that nobody could detect the device...
M: We gave it a simple task to fly round the square. It didn’t return to the initial point.
D: Was that square large?
M: It’s none of your business! This is the State secret! You are to find the device!
Programmer (P): How did you programme the mission profile?
M: The device was to fly one conditional length unit to the North, the same distance to the East, the same distance to the South and then to the West. It passed more than 40 minutes since the device was to return. If they find it before us!.. In short, you are to find it!
D: It’s understood. Where was the initial point?
(The major flags and in two seconds the designer lies on the floor with his hands tied and two gunpoints look at his nape).
M: Why do you need this information?
E: You misunderstood! We don’t need information! But if we knew the initial point coordinates we could say where the device was...
(In two seconds two gunpoints look at the engineer’ nape, too).
M: Who interests this information? Where is the device? One, two, ...
P: You can’t understand! If the device reached the North Pole it can’t continue not to the North. Not to the East. Only to the South! Where the device is depends on where it started.
(Major aims at the programmer.)
M: No, it didn’t reach the Pole. It was taken into account.
P: Let me write a program that would count the final coordinates of the device. You’ll input the latitude, the longitude and the value of your conditional length unit yourself! The program would give you the answer keeping the absolute secrecy.
M: I’ll give you a chance. You three have got a computer and five hours... Less than five hours already. If we do not get the coordinates... You’ll suffer first.

Input

The first line contains the initial latitude W. –90 < W < 90. The second line – the initial longitude L, -180 < L ≤ 180. The third line contains the length of the square side, which the device was to fly round. The length is given in kilometers. The device keeps the fixed distance 6400 km from the Earth center of mass. The South Pole has latitude –90, the North Pole – latitude 90. The East direction is counted off the 0th meridian in the positive direction.

Output

You should output the final latitude and longitude of the device within three digits after a decimal point.

Sample

input output
56.846841
53.36673
1124.427
56.847
60.631
Problem Author: Stanislav Vasilyev
Problem Source: USU Championship 2004
Difficulty: 1115
 
题意:地球(R=6400km)表面有一个飞行器,先往北飞,再往东飞,再往南飞,再往西飞,都飞相同距离l。
 给定这个小东西的起始经纬度(北正南负东正西负),求飞完之后的经纬度。 
分析:
造成误差的原因是因为改变纬度后,所对应的圆的半径改变,造成相同距离而却有不同的经度变化。
那么算出各自的经度变化再相减就好。
我傻逼,一开始居然没想到怎么造成误差。
果然是数学喳喳。
 /**
Create By yzx - stupidboy
*/
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <ctime>
#include <iomanip>
using namespace std;
typedef long long LL;
typedef double DB;
#define For(i, s, t) for(int i = (s); i <= (t); i++)
#define Ford(i, s, t) for(int i = (s); i >= (t); i--)
#define Rep(i, t) for(int i = (0); i < (t); i++)
#define Repn(i, t) for(int i = ((t)-1); i >= (0); i--)
#define rep(i, x, t) for(int i = (x); i < (t); i++)
#define MIT (2147483647)
#define INF (1000000001)
#define MLL (1000000000000000001LL)
#define sz(x) ((int) (x).size())
#define clr(x, y) memset(x, y, sizeof(x))
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define ft first
#define sd second
#define mk make_pair
inline void SetIO(string Name)
{
string Input = Name+".in",
Output = Name+".out";
freopen(Input.c_str(), "r", stdin),
freopen(Output.c_str(), "w", stdout);
} inline int Getint()
{
int Ret = ;
char Ch = ' ';
bool Flag = ;
while(!(Ch >= '' && Ch <= ''))
{
if(Ch == '-') Flag ^= ;
Ch = getchar();
}
while(Ch >= '' && Ch <= '')
{
Ret = Ret * + Ch - '';
Ch = getchar();
}
return Flag ? -Ret : Ret;
} const DB Pi = acos(-1.0), R = 6400.0;
DB Latitude, Longitude, Length; inline void Input()
{
cin >> Latitude >> Longitude >> Length;
} inline void Solve()
{
DB Delta =
Length / (R * cos(Latitude / * Pi+ Length / R)) -
Length / (R * cos(Latitude / * Pi));
Delta = Delta / ( * Pi) * ;
Longitude += Delta;
while(Longitude > 180.0) Longitude -= 360.0;
while(Longitude <= -180.0) Longitude += 360.0;
printf("%.3lf\n%.3lf\n", Latitude, Longitude);
} int main()
{
#ifndef ONLINE_JUDGE
SetIO("D");
#endif
Input();
Solve();
return ;
}

ural 1341. Device的更多相关文章

  1. URAL - 1900 Brainwashing Device

    While some people travel in space from planet to planet and discover new worlds, the others who live ...

  2. ural 2062 Ambitious Experiment

    2062. Ambitious Experiment Time limit: 3.0 secondMemory limit: 128 MB During several decades, scient ...

  3. Linux系统中的Device Mapper学习

    在linux系统中你使用一些命令时(例如nmon.iostat 如下截图所示),有可能会看到一些名字为dm-xx的设备,那么这些设备到底是什么设备呢,跟磁盘有什么关系呢?以前不了解的时候,我也很纳闷. ...

  4. Eclipse调试Android App若选择“Use same device for future launches”就再也无法选择其他设备的问题

    在狂批了某供应商的多媒体控制App有多烂后,夸下海口自己要做一个也是分分钟的事.当然要做好不容易,要超过他们的烂软件还是有信心的.过程中遇到各种坑,其中之一如下 刚开始只使用一个平板进行调试,老是弹出 ...

  5. 设备模型(device-model)之平台总线(bus),驱动(driver),设备(device)

    关于关于驱动设备模型相关概念请参考<Linux Device Drivers>等相关书籍,和内核源码目录...\Documentation\driver-model 简单来说总线(bus) ...

  6. xamarin.forms uwp app部署到手机移动设备进行测试,真机调试(device portal方式部署)

    最近学习xamarin.刚好 手上有一个lumia 930.所以试一试把uwp app部署到手机上,并真机调试一把. 目前环境: 1.开发pc电脑是win10,版本1607.加入了insider,所以 ...

  7. STM32用JLINK 烧写程序时出现NO Cortex-m device found in JTAG chain现象和解决方案

    现象 CPU: STM32107VC 用JLINK 烧写程序时出现NO Cortex-m device found in JTAG chain 如图无法查找到硬件就是CPU 提示1:NO Cortex ...

  8. “(null)” is of a model that is not supported by this version of Xcode. Please use a different device.

    ios    真机运行程序就弹出这个"(null)" is of a model that is not supported by this version of Xcode. P ...

  9. Device Tree(二):基本概念

    转自:http://www.wowotech.net/linux_kenrel/dt_basic_concept.html 一.前言 一些背景知识(例如:为何要引入Device Tree,这个机制是用 ...

随机推荐

  1. Swift - enumerateObjectsUsingBlock的用法

    enumerateobjectsusingblock:不是Array的方法在NSArray使用.如果你想使用它,你需要一个实例NSArray而不是Array. import Foundation va ...

  2. HBase参数配置及说明(转)

    版本:0.94-cdh4.2.1 hbase-site.xml配置 hbase.tmp.dir 本地文件系统tmp目录,一般配置成local模式的设置一下,但是最好还是需要设置一下,因为很多文件都会默 ...

  3. 关于s:iterator 和s:if 的结合使用

    <s:iterator value="list" status="st"> <div class="sidebar-nav" ...

  4. 数据结构和算法 – 12.高级查找算法(下)

    哈希(散列)技术既是一种存储方法,也是一种查找方法.然而它与线性表.树.图等结构不同的是,前面几种结构,数据元素之间都存在某种逻辑关系,可以用连线图示表示出来,而哈希技术的记录之间不存在什么逻辑关系, ...

  5. 15.命令模式(Command Pattern)

    using System; namespace ConsoleApplication8 { class Program { /// <summary> /// 在软件系统中,“行为请求者” ...

  6. hdu 1698:Just a Hook(线段树,区间更新)

    Just a Hook Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  7. 攻城狮在路上(叁)Linux(三十一)--- vim程序编辑器

    本篇主要介绍vim编辑器的使用方式,具体内容后续补充.

  8. 杂物 git rebase

  9. codeforce好地方啊 Bear and Elections *

    Codeforces Round #318 居然可以看测试数据,哪里没过一目了然,哈哈哈 #include<cstdio> #include<iostream> #includ ...

  10. 直传文件到Azure Storage的Blob服务中

    (此文章同时发表在本人微信公众号“dotNET每日精华文章”,欢迎右边二维码来关注.) 题记:为了庆祝获得微信公众号赞赏功能,忙里抽闲分享一下最近工作的一点心得:如何直接从浏览器中上传文件到Azure ...