分析:
首先要时间最短,必然是某一瞬间全部人一起到达终点。
其次,既然是一起到达终点,必然每个人 走路和坐车时间相同。(否则不可能一起到)
设一个人搭车往前走的时间为t2,车子载完一个人后往回走的时间为t3,车子一共要往返tang躺,tang=(n+k-1)/k。
t3=t2*(v2-v1)/(v1+v2),
t1=(tang-1)*(t2+t3),
则有t2*v2+t1*v1=L,
解得, double t1=【2*v2/(v1+v2)*(tang-1)】*t2;
double t2=l/(t1/t2*v1+v2);
ans=t2+t1;
参考程序:
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <iostream>
using namespace std;
double v1,v2,l;
int n,k;
int main()
{
cin>>n>>l>>v1>>v2>>k;
int tang=(n+k-1)/k;
double t1=2*v2/(v1+v2)*(tang-1);
double tt=t1;
double t2=l/(t1*v1+v2);
printf("%.6lf\n",t2+t2*tt);
}
本文详细解析了在给定人员数量、终点距离及步行与乘车速度的情况下,如何通过数学建模求解最优的人员运输方案,确保所有人同时抵达终点且用时最短。文中给出了具体的算法步骤,并附带参考程序实现。
1613

被折叠的 条评论
为什么被折叠?



