【想清楚】Chris and Road

来源:互联网 发布:ubuntu vmdk 下载 编辑:程序博客网 时间:2024/05/04 10:09
#include <cstdio>#include <algorithm>#include <string>#include <map>#include <algorithm>#include <iostream>using namespace std;int main(){int n;double w, v, u;cin >> n >> w >> v >> u;double zt=0;int ok1 = 1, ok2 = 1;for (int i = 0; i < n; i++){double x, y;cin >> x >> y;if (x / v < y / u)ok1 = 0;if (x / v > y / u)ok2 = 0;zt = max(zt, x / v + (w - y) / u);}if (ok1 || ok2)printf("%.10f\n", w / u);elseprintf("%.10f\n", zt);//system("pause");return 0;}

原创粉丝点击