文章
18
粉丝
183
获赞
57
访问
101.8k
想通了,代码就很简单了
代码如下
#include <bits/stdc++.h>
using namespace std;
struct node
{
int v;
int k;
int s;
double t;
};
int d, n;
int main()
{
while (cin >> d >> n)
{
node car[n];
double max_t = 0;
for (int i = 0; i < n; i++)
{
cin >> car[i].k >> car[i].v;
car[i].s = d - car[i].k;
car[i].t = car[i].s * 1.0 / car[i].v;
max_t = max(max_t, car[i].t);
}
...
登录后发布评论
暂无评论,来抢沙发