2 shunfurh shunfurh 于 2017.09.13 08:57 提问

War on Weather

After an unprovoked hurricane attack on the south shore, Glorious Warrior has declared war on weather. The first salvo in this campaign will be a coordinated pre-emptive attack on as many tropical depressions as possible. GW reckons that the attack will neutralize the tropical depressions before they become storms, and dissuade others from forming.
GW has at his disposal k space-to-earth killer satellites at various locations in space. m tropical depressions are known to exist at various locations on the earth's surface. Each satellite can attack any number of targets on the earth provided there is line of sight between the satellite and each target. How many different targets can be hit?

The input consists of several test cases. Each case begins with a line containing integers 0 < k, m &le 100 as defined above. k lines follow, each giving x,y,z - the location in space of a satellite at the scheduled time of attack. m lines then follow, each giving


x,y,z - the location of a target tropical depression. Assume the earth is a sphere centred at (0,0,0) with circumference 40,000 km. All targets will be on the surface of the earth (within 10-9 km) and all satellites will be at least 50 km above the surface. A line containing 0 0 follows the last test case.

For each test case, output a line giving the total number of targets that can be hit. If a particular target falls within 10-8 km of the boundary between being within line-of-sight and not, it may be counted either way. (That is, you need not consider rounding error so long as it does not exceed 10-8 km.)

Sample Input

3 2
-10.82404031 -1594.10929753 -6239.77925152
692.58497298 -5291.64700245 4116.92402298
3006.49210582 2844.61925179 5274.03201053
2151.03635167 2255.29684503 5551.13972186
-1000.08700886 -4770.25497971 4095.48127333
3 4
0 0 6466.197723676
0 6466.197723676 0
6466.197723676 0 0
6366.197723676 0 0
6365.197723676 112.833485488 0
0 0 6366.197723676
0 -6366.197723676 0
0 0

Sample Output



devmiao   Ds   Rxr 2017.09.13 08:59
Csdn user default icon
hdu 1140 War on Weather
题目地址 题目大意:给出地球外的k个点,地球表面的m个点,求地球外的点是否能看见地球表面的点 解题思路:地球外的点对地球做切线,若地球往外的点到地球表面点的距离 #include #include #include #include using namespace std; const int maxn = 100+10; const double PI=acos(-1.0);
HDU 1140 War on weather
有一些卫星在天上,还有一些目标在地球表面,判断一下有多少目标会被卫星看见。 设卫星为 S,目标为T,球心为O,过T做地球切线切点为A。 一开始想判断∠STO是否 >= 90°,但是一直不对,可能是精度的问题。 然后又用比较ST是否 总之这又是个比较简单的题。 #include #include #include #include #include #include #i
hdu1140 War on Weather
题目链接:hdu1140    pku2660 方法:计算几何 思想:本题是给定k颗卫星,m个地点,看这卫星能够射到几个地方。 首先将卫星的坐标保存,然后每读入一个地点,就判断能否有卫星能够 发射到本地。由于地点均在地球表面,在判断某卫星能否到达本地时, 可以通过卫星所
hdu1140 war on weather
C - War on Weather Crawling in process... Crawling failed Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1140 Description
Sicily 1118. War on Weather
1118. War on Weather Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description After an unprovoked hurricane attack on the south shore, Glorious Warrior has declared war on weather
原题出处:HDOJ Problem Index by Type,http://acm.hdu.edu.cn/typeclass.php杭电OJ分类题目(3)HDU Computational GeometryHDU 1086 You can Solve a Geometry Problem tooHDU 1115 Lifting the StoneHDU 1140 War on WeatherHD...
poj 2660 War on Weather 计算几何
//poj 2660 //sep9 #include #include using namespace std; const double pi=acos(-1.0); const double radius=20000.0/pi; struct P { double x,y,z,angle; }satellite[128]; double dist(double x,double y
uva 10915 - War on Weather(几何)
题目链接:uva 10915 - War on Weather 点和球的切线大于点到预定点的距离,即为可达。 #include #include #include #include using namespace std; const int maxn = 105; const double pi = 4 * atan(1.0); const double R =
HDOJ HDU 1140 War on Weather
HDOJ 1140 War on Weather
Yahoo Weather API 理解和分析
Yahoo Weather API 的使用还是比较简单的,只需要传两个参数即可。 需要注意的是,该API经历过一次改版,而目前网上的很多经验文章都是采取的old版本的API,而实践发现,old版本的查询结果貌似已经失效了。下面是新旧版本参数对照: old 版本: Parameter Description Example p US zip