hdoj-2273-The buses
来源:互联网 发布:网络协议分析课后答案 编辑:程序博客网 时间:2024/05/21 19:34
The buses
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 623 Accepted Submission(s): 312
Problem Description
Garfield applied for a good job recently, and he will go to work soon by car or bus. Garfield is very broody, sometimes when he sits on the bus to wait for the traffic light, he thinks about how long all the buses pass the traffic turning.
Now we describe the situations when the buses stop at the traffic turning to wait for the traffic light. First the light is red, then when the light changes to green, all the buses are prepared to move. And at the beginning, all the buses are close to each other without any space, and they have different lengths and the largest speeds. We assume any car can reach the speed that isn’t beyond the maximal speed at once.
Now Garfield wants you to calculate minimal time all the buses pass the turning.
Now we describe the situations when the buses stop at the traffic turning to wait for the traffic light. First the light is red, then when the light changes to green, all the buses are prepared to move. And at the beginning, all the buses are close to each other without any space, and they have different lengths and the largest speeds. We assume any car can reach the speed that isn’t beyond the maximal speed at once.
Now Garfield wants you to calculate minimal time all the buses pass the turning.
Input
There are many cases. For each case, there is two intergers N(1<=N<=100), representing the number of the buses. There are two interges in the following N lines, for the length Li(meter, 1<=Li<=10) and the maximal speed Si(meter/second, 1<=Si<=10) of the i-th bus.
Output
For each case, print the result obtaining two digits after the decimal point.
Sample Input
21 22 3
Sample Output
1.50
Source
HDU 8th Programming Contest Site(1)
Recommend
lcy | We have carefully selected several similar problems for you:2274 2276 2278 2279 2275
#include<stdio.h>#include<algorithm>using namespace std;int main(){int n;while(~scanf("%d",&n)){int as=0,a,b;int v=111;for(int i=0;i<n;++i){scanf("%d%d",&a,&b);as+=a;v=min(v,b);} printf("%.2lf\n",1.0*as/v);} return 0;}
0 0
- hdoj-2273-The buses
- HDU-2273 The buses
- PKU1167 the buses
- poj 1167 The Buses
- POJ 1167 The Buses
- poj 1167 the buses
- HDU2273-The buses
- POJ 1167 The Buses 笔记
- IOI 1994 169:The Buses
- Buses
- 【搜索+强剪枝】PKU-1167-The Buses
- The Buses (poj 1167 搜索)
- POJ 1167 The Buses 暴搜+剪枝
- HDOJ Color the ball
- HDOJ Assign the task
- HDOJ Watch The Movie
- hdoj Buy the Ticket
- Hdoj Minimize The Difference
- hdu 1709 The Balance
- 暑假集训第二周——递推 骆驼猜名字
- Android 底部菜单配合listview的问题
- Xcode6以上不能安装插件管理工具解决办法
- 说说nio----1
- hdoj-2273-The buses
- HDOJ--1425 SORT (刚开始学ACM,用的是最简单的方法)
- 读取摄像头视频信息(解决VS运行过程中窗口闪一下关闭的问题)
- 如何将一个字符串倒序输出
- 51-android.rules详解
- iOS开发入门教程 iPhone开发相关学习资料
- 脱壳学习笔记二:识别OEP
- android之适配器
- WPF使用DEV之TreeListControl---修改树列显示的名字