当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2501:Average Speed

题目描述
You have bought a car in order to drive from Waterloo to a big city. The odometer on their car is broken, so you cannot measure distance. But the speedometer and cruise control both work, so the car can maintain a constant speed which can be adjusted from time to time in response to speed limits, traffic jams, and border queues. You have a stopwatch and note the elapsed time every time the speed changes. From time to time you wonder, "how far have I come?". To solve this problem you must write a program to run on your laptop computer in the passenger seat.
输入解释
Standard input contains several lines of input: Each speed change is indicated by a line specifying the elapsed time since the beginning of the trip (hh:mm:ss), followed by the new speed in km/h. Each query is indicated by a line containing the elapsed time. At the outset of the trip the car is stationary. Elapsed times are given in non-decreasing order and there is at most one speed change at any given time.
输出解释
For each query in standard input, you should print a line giving the time and the distance travelled, in the format below.
输入样例
00:00:01 100
00:15:01
00:30:01
01:00:01 50
03:00:01
03:00:05 140
输出样例
00:15:01 25.00 km
00:30:01 50.00 km
03:00:01 200.00 km

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2501

最后修改于 2020-10-29T06:34:18+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536