比赛 noip-081029 评测结果 AAAAAAA
题目名称 最小乘车费用 最终得分 100
用户昵称 MayLava 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-10-29 22:09:55
显示代码纯文本
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.