假设赤道上有且仅有一座机场,并有若干架飞机,每架飞机的油量可保证飞半个赤道的距离。现在要求一架飞机从机场起飞,绕赤道一圈后,返回机场。在该飞机飞行过程中,不能中途降落、返回。其他飞机可返回,也可在空中给飞机加油,但不能降落,且必须返回机场。求飞机飞行和加油策略。

思路

假设完成环球飞行的飞机为A,由于A的油量仅满足飞行赤道半圈,所以必须通过其他飞机给其加油。
而其他飞机给A加油时,也需要使自己剩余的油量能够保证返回机场,因此,尽量在离机场近的空中给A加油,这样的策略才较优,因此,首先初步的策略是:
A飞行至1/4圈处,其他同向飞行的飞机给A加满油返回,A独自飞行1/2圈,至3/4圈处,从机场逆向起飞的飞机飞行至3/4圈处,给A加适量油,保证其继续飞行至机场。
220439818
图中,矩形框表示A的油箱。
针对上述初步策略,下面需要求解的问题是:从0至1/4圈和从3/4圈至1圈,如何安排飞机给A加油并保证其他飞机返回。
从0至1/4圈的解决方案是:
1)A和B1、B2从机场起飞,飞至1/8圈处,B2分别给A、B1加满油,剩下1/4的油可返回机场。
221936254
2)A和B1飞至1/4圈处,B1给A加满油,剩下1/2的油可返回机场。
222029678
从3/4至1圈的解决方案是:
1)A独自飞行至3/4圈处,迎面飞来的C1给A加1/4油,剩下1/4油。
223535930
2)A、C1飞行至7/8圈处,迎面飞来的C2分别给A、C1加1/4油,剩下1/4油,从而三架飞机均可返回机场。
223422555

Move Zeroes

Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements. For exa...

阅读全文

Odd Even Linked List

Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not ...

阅读全文

Remove Duplicates from Sorted Array

Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space...

阅读全文