英语翻译A group of N people wishes to go across a river with onl

英语翻译
A group of N people wishes to go across a river with only one boat,which can at most carry two persons.Therefore some sort of shuttle arrangement must be arranged in order to row the boat back and forth so that all people may cross.Each person has a different rowing speed; the speed of a couple is determined by the speed of the slower one.Your job is to determine a strategy that minimizes the time for these people to get across.
Input
The first line of the input contains a single integer T (1
tkqp7h 1年前 已收到1个回答 举报

江湖-告急 幼苗

共回答了15个问题采纳率:93.3% 举报

虽然,意译出来了.不过,根据你给的 样例,似乎,有问题.
不知道你,是否帖错了数据.
题目描述:
有N个人想要用一只船过河,并且这只船一次最多只能承载两个人.因此,这就需要一个有序的安排来使得船能够过去,然后被送回来,最后使得所有的人都能过河.每个人划船的速度各不相同.如果几个人一起乘船的话,那么船的速度等于速度最慢的那个人的划船速度.你的任务就是决定一个策略使得所有的人过河所花的时间最短.
输入:
第一行将包含一个整形数T(1

1年前

7
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.017 s. - webmaster@yulucn.com