luogu#P7069. [NWRRC2014] Joy of Flight
[NWRRC2014] Joy of Flight
题目描述
Jacob likes to play with his radio-controlled aircraft. The weather today is pretty windy and Jacob has to plan flight carefully. He has a weather forecast — the speed and direction of the wind for every second of the planned flight.
The plane may have airspeed up to units per second in any direction. The wind blows away plane in the following way: if airspeed speed of the plane is and the wind speed is , the plane moves by each second.
Jacob has a fuel for exactly seconds, and he wants to learn, whether the plane is able to fly from start to finish in this time. If it is possible he needs to know the flight plan: the position of the plane after every second of flight.
输入格式
The first line of the input file contains four integers — coordinates of start and finish ().
The second line contains three integers and — the number of wind condition changes, duration of Jacob’s flight in seconds and maximum aircraft speed ().
The following lines contain the wind conditions description. The -th of these lines contains integers and — starting at time the wind will blow by vector each second ($0 = t_1 < ··· < t_i < t_{i+1} < ··· < k; \sqrt{w_{x_i}^2 + w_{y_i}^2} ≤ v_{\max}$).
输出格式
The first line must contain Yes
if Jacob’s plane is able to fly from start to finish in k seconds, and No
otherwise.
If it can to do that, the following lines must contain the flight plan. The -th of these lines must contain two floating point numbers and — the coordinates of the position () of the plane after -th second of the flight.
The plan is correct if for every it is possible to fly in one second from to some point , such that distance between and doesn’t exceed , where . Moreover the distance between and should not exceed as well.
题目大意
简述
大意就是一架飞机要从起点飞到终点,飞机有最大空速,飞行最大时间,给出风速的变化和风如何影响飞机飞行,求出飞机是否能到达终点,如果能就输出飞机的位置变化。
题目描述
雅各布(Jacob)喜欢玩他的无线电摇制飞机。今天的风很大,雅各布必须小心地计划飞行。他有一个天气预报——飞行计划中每秒钟的风速和风向。
飞机每秒在任何方向的空速最大都可以达到 。风吹动飞机的方式如下:如果飞机的空速是 并且风速是 ,那么飞机每秒将移动 。
雅各布(Jacob)有一种刚好能使用秒的燃料,他想知道,飞机是否能在这段时间内从起点飞到终点。如果可能的话,他需要知道飞行计划:每飞行一秒后飞机的位置。
输入格式
输入文件的第一行有四个整数 ,代表起始位置 。
第二行有三个整数 ——风况变化的次数,雅各布(Jacob)飞行持续的时间(以秒为单位)和飞机最大空速。
剩下的 行是对风向的描述,第 行有三个整数 ——从时间 开始,风速为每秒 (一个向量) $(0=t_1< \cdots <t_i<t_{i+1}< \cdots <k; \sqrt{{w^2_{xi}}+{w^2_{yi}}} \le v_{max})$ 。
输出格式
如果 秒内雅各布(Jacob)的飞机能从起点飞到终点则应输出 Yes
,否则输出 No
。
如果它能飞到,接下来的 行必须包括飞行计划。第 行必须包括两个浮点数 和 (保留几位貌似没说)——飞行了第 秒的平面位置 。
如果对于每个 都能在一秒内从点 飞到某个点 ,使得 和 间距离不超过 ,其中 ,那么这个计划就是正确的。此外 和 间的距离也应不超过 。
说明/提示
时间限制: ;内存限制:
by XYY1411
2020/12/08
1 1 7 4
2 3 10
0 1 2
2 2 0
Yes
3 2.5
5 2.5
7 4
提示
Time limit: 2 s, Memory limit: 256 MB.