📄 b.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0044)http://plg.uwaterloo.ca/~acm00/010602/B.html -->
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=GB18030">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY><IMG src="B.files/mont02.jpg" align=right>
<H2>Problem B - Subway</H2>Subway trains are meant to move people as quickly,
safely, and comfortably as possible from station to station. Although the train
drivers' unions may not agree, computer operated trains accomplish these goals
more effectively than human operated trains. You are to determine the optimal
control strategy to move the train from one station to another within the
constraints imposed by safety and comfort considerations, as well as the
physical limitations of the train itself.
<P>The parameters to the problem are all positive integers not greater than
1000.
<UL>
<LI><I>d</I> - the distance between stations, in metres
<LI><I>m</I> - the maximum allowable speed of the train, in metres/sec
<LI><I>a</I> - the maximum absolute acceleration of the train, in
metres/sec<SUP>2</SUP>
<LI><I>j</I> - the maximum absolute <I>jerk</I>, in metres/sec<SUP>3</SUP>
</LI></UL>The train must be completely stopped at each station and must move in
one direction at speeds not exceeding <I>m</I>. Acceleration can be positive
(forward) or negative (backwards) but its absolute value must not exceed
<I>a</I>. The last parameter, <I>jerk</I>, is the rate of change of acceleration
in either direction. That is, acceleration cannot increase or decrease at
greater than this rate. This parameter prevents toppling the standing
passengers.
<P>There are several test cases. For each test case, standard input has a single
line with <I>d, m, a, j</I>. For each test case, standard output should contain
a single line giving the minimum time in seconds, to the nearest 0.1 second,
required to move between the stations.
<H3>Sample Input</H3><PRE>1000 70 20 1
</PRE>
<H3>Output for Sample Input</H3><PRE>31.7
</PRE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -