2 shunfurh shunfurh 于 2017.09.03 00:33 提问

Radar Scopes

You have been hired to a team of software designers to write a new air- traffic control system. One of the functions of this new software is to automatically verify the functioning of the subject aircrafts' instrumentation and alert controllers to endangered, newly aloft, or possibly downed aircraft. You are to write a prototype of this function.
Your program will be given a series of scenarios which include 2 radar sweeps each. Each radar sweep will find 0 to 100 airplanes. Each time a sweep encounters a plane, the data acquisition system captures an azimuth reading and distance (in miles) from the radar. It will also retrieve (from the plane) a squawk number and a ground speed in miles/hour (actually an airspeed with wind corrections). Based on the two radar sweeps, your program is to determine if a warning is required for any plane in the radar's domain.

You should assume a radar range (radius of the area covered) of 10 miles and instantaneous sweeps that occur 5 seconds apart.

Based on the information about the radar and planes, you are to determine if the controllers should be warned of potential problems.

An ``equipment warning" is issued if the average of the plane's two indicated airspeeds is not within 10% of the airspeed measured/calculated based on radar sweeps.

A new intrusion" warning is issued if the second radar sweep indicates a plane which was not present in the first sweep, but whose indicated airspeed + 10% is sufficient to have brought the plane onto the scope (on the shortest path) between the two sweeps. If the speed is not sufficient to account for a plane which was already aloft, then the assumption must be made that there is anew aloft" warning to be issued because a plane has just taken off within the domain of the radar.

A domain exited" warning is issued if the first sweep of the radar indicates a plane which is not seen in the second sweep but whose indicated airspeed + 10% is sufficient to have accounted for the plane leaving the range of the radar (on the shortest path) within the two sweeps. If the speed is not sufficient to allow the plane to leave the radar scope between the sweeps, adomain loss" warning is issued indicating that the plane has either landed or crashed with the controller's domain.

Input

The first line of each scenario contains a single integer (0 <= N1 <= 100) that indicates the number of planes detected in the first sweep. The next N1 lines each contain the description of exactly one detected plane in sweep 1. Each description contains a squawk number, an azimuth, a distance, and a ground speed. The squawk number is an integer between 1 and 5 digits in length. The azimuth, distance and ground speed are all real numbers in the format XXX.XXX with leading and trailing zeroes as needed to fill all 6 places.

The squawk number (0 < S < 32767) is a globally unique integer that identifies each plane and is used to match planes from sweeps 1 and 2. The azimuth (000.000 <= A <= 359.999) is the angle in degrees from North (sweeping in a circle toward the East) where the plane was detected. Therefore, East is at 90 degrees; South is at 180 degrees; and West is at 270 degrees. The distance (000.000 <= D <= 010.000) is the distance from the radar to the plane (added distance due to altitude has been removed by the radar's sensing logic). The ground speed (000.000 <= G <= 999.999) is the speed at which the plane is moving (in any direction) relative to the radar.

Immediately following the lines with the descriptions of planes in the first sweep is a line with a single integer (0 <= N2 <= 100) indicating the number of planes detected in the second sweep. The next N2 lines each contain the description of exactly one detected plane in sweep 2.

The next scenario (if any) starts with N1 on the next line. You are to read and process scenarios to the end-of-file.

Output

For each scenario, you are to print Scenario # X" where X is the number of the scenario starting with 1 for the first scenario and incrementing by 1 for successive scenarios. Each subsequent line contains exactly one report for each plane requiring a warning indication. These lines are to be sorted based on the squawk number. Reports consist of the squawk number right-justified in columns 1 to 5 and one of the following warnings -- equipment warning", -- new intrusion", -- new aloft", -- domain exited", or -- domain loss" starting in column 6. (You must print the blanks and dashes exactly as shown in the strings above.) There are no messages printed for planes for whom no warning applies.

After each scenario, print a blank line.

Sample Input

4
222 060.111 007.600 095.000
1496 203.122 009.444 598.991
111 000.000 005.100 999.999
013 333.333 006.711 188.448
4
111 001.000 003.713 999.999
777 263.122 009.933 477.633
333 083.014 004.300 127.122
222 040.713 009.813 098.125

Sample Output

Scenario # 1
013 -- domain loss
222 -- equipment warning
333 -- new aloft
777 -- new intrusion
1496 -- domain exited

1个回答

caozhy
caozhy   Ds   Rxr 2017.09.17 22:41
已采纳
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
angular学习(五)—— Scopes
转载请写明来源地址:http://blog.csdn.net/lastsweetop/article/details/51833370Scopes简介Scopes是一个指向application模型的对象,是表达式执行的上下文,模拟application的DOM结构构成自己的层次结构。Scope可以观察表达式和传播事件。Scopes特点Scopes提供了API $watch观察model的变化。
网站性能测试 工具 阿里云 pt Performance Testing radar Linux 和 windows 版本使用
先打个广告,个人感觉是比较方便的。 阿里云性能测试(Performance Testing)是全球领先的SaaS性能测试平台,具有强大的分布式压测能力,可模拟海量用户真实的业务场景,让应用性能问题无所遁形。性能测试包含两个版本,Lite版适合于业务场景简单的系统,免费使用;企业版适合于承受大规模压力的系统,同时每月提供免费额度,可以满足大部分企业客户。阿里云性能测试帮您轻松完成系统性能评估 1
函数内部的[[scope]]属性
函数内部的[[scope]]属性是虚拟出来的一个属性,我们实际访问时访问不到这个属性的,这个属性是为了让我们更好的理解函数,虚拟出来的一个属性。我们在创建函数时就会生成这样的一个属性,这个属性保存着这个函数的父作用域的作用域链。在函数执行时,函数会生成一个scope属性,这个属性保存着函数在执行上下文时创建的活动对象(活动对象包括函数内部的局部变量和函数参数)和函数的内部的[[scope]]属性。这
(译)理解AngularJS中的Scopes
(初次翻译,有些地方翻译的不准确,还请对照原文理解:https://github.com/angular/angular.js/wiki/Understanding-Scopes)概要AngularJS中,子作用域通常是原型继承自他的父作用域。这个规则的一个例外就是使用了scope:{...} 的指令——这个创建了一个“隔离”的作用域,不是以原型继承的方式(以及使用了transclusion的指令)
Spring Security OAuth2# Scope
怎么传递scopehttp://localhost:8080/oauth/token?grant_type=password&scope=ROLE_CLIENT_ADMIN+Hidelo&client_id=business&client_secret=business&username=user&password=password 解析的逻辑如下: DefaultOAuth2Request
Spotlight Synthetic Aperture Radar Signal Processing Algorithms_部分1
《Spotlight Synthetic Aperture Radar Signal Processing Algorithms》原始文件超过60M,没有办法上传,故分为两部分,这是第一部分。 这本书是1995年的经典书,虽然标题是聚束SAR信号处理算法,但是里面讲述的经典内容不仅仅适用于聚束SAR,而是对更广阔的SAR也是通用的。 这本书讲述了:合成孔径雷达基础;聚束SAR和极化格式算法;数字极化格式处理;相位误差;自聚焦技术;处理设计例程;SAR系统性能;聚束SAR处理应用;RMA算法;CS算法等内容。
Camera-Radar Fusion
TI publishes a nice video showing a fusion between so different views from an automotive radar and a camera
JavaScript对象系统深入剖析-4.Scope和Closure(闭包)
4.       Scope和Closure@吴穹Adam(新浪)注: 在阅读本节之前,请先阅读1-3,http://blog.csdn.net/adwu73/article/details/7229563   Scope是JS中非常关键的概念,搞清楚它,才能搞清楚闭包(Closure)。对Scope的解释,JavaScript: The Definitive Guide这本书解释的非常清楚,而J
POJ:1328 Radar Installation 思路以及测试数据
Radar Installation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 76845   Accepted: 17213 Description Assume the coasting is an infinite straight line. Land
【高清版】Fundamentals of Radar Signal Processing 2nd
The most complete, current guide to the signal processing techniques essential to advanced radar systems Fully updated and expanded, Fundamentals of Radar Signal Processing, Second Edition, offers comprehensive coverage of the basic digital signal processing techniques and technologies on which virtually all modern radar systems rely, including target and interference models, matched filtering, waveform design, Doppler processing, threshold detection, and measurement accuracy. The methods and interpretations of linear systems, filtering, sampling, and Fourier analysis are used throughout to provide a unified tutorial approach. End-of-chapter problems reinforce the material covered. Developed over many years of academic and professional education, this authoritative resource is ideal for graduate students as well as practicing engineers. Fundamentals of Radar Signal Processing, Second Edition, covers: Introduction to radar systems Signal models Pulsed radar data acquisition Radar waveforms Doppler processing Detection fundamentals Measurements and tracking Introduction to synthetic aperture imaging Introduction to beamforming and space-time adaptive processing