| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
不规范答案。改改就好program wxy;
var
max,len,n:integer;
box,speed:array[1..100] of integer;
book:array[0..1000] of real;
procedure init;
var
a:integer;
f:text;
begin
assign(f,'bridge.in');
reset(f);
readln(f,max,len,n);
for a:=1 to n do readln(f,box[a],speed[a]);
close(f);
end;
procedure main;
var
a,s,total,slow:longint;
begin
fillchar(book,sizeof(book),0);
book[1]:=len/speed[1];
for a:=2 to n do
begin
total:=0;
s:=a;
slow:=speed[a];
while s>=1 do
begin
inc(total,box[s]);
if total>max then break;
if slow>speed[s] then slow:=speed[s];
if (book[a]=0) or (book[a]>book[s-1]+len/slow) then book[a]:=book[s-1]+len/slow;
dec(s);
end;
end;
end;
procedure out;
var
f:text;
begin
assign(f,'bridge.out');
rewrite(f);
write(f,book[n]*60:0:1);
close(f);
end;
begin
init;
main;
out;
end.
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator