记录编号 5988 评测结果 AAAAAAA
题目名称 最小乘车费用 最终得分 100
用户昵称 GravatarMayLava 是否通过 通过
代码语言 Pascal 运行时间 0.002 s
提交时间 2008-10-30 08:23:29 内存使用 38.25 MiB
显示代码纯文本
program MayLava;
var
 scv:array[0..10000000]of longint;
 cost:array[0..10]of longint;
 n:longint;
procedure start;
 var
  f:text;
  i:longint;
 begin
  assign(f,'busses.in');
  reset(f);
  for i:=1 to 10 do
   read(f,cost[i]);
  readln(f);
  readln(f,n);
  close(f);
  for i:=1 to n do
   scv[i]:=maxlongint;
 end;
procedure main;
 var
  i,j:longint;
 begin
  for i:=1 to 10 do
   for j:=0 to n do
    if (i<=j) and (scv[j]>scv[j-i]+cost[i]) then
     scv[j]:=scv[j-i]+cost[i];
 end;
procedure print;
 var
  f:text;
 begin
  assign(f,'busses.out');
  rewrite(f);
  writeln(f,scv[n]);
  close(f);
 end;
BEGIN
 start;
 main;
 print;
END.