比赛 noip20081103 评测结果 AWAAWWWWWA
题目名称 奶酪工厂 最终得分 40
用户昵称 NickName 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2008-11-03 20:05:55
显示代码纯文本
program factory;
var n:longint;
s:longint;
cost:array[1..10000] of integer;
need:array[1..10000] of integer;
fi,fo:text;
x1,x2:longint;
xuyao:longint;
ls:longint;
jg:longint;
begin
assign(fi,'factory.in');
reset(fi);
readln(fi,n,s);
for x1:=1 to n do
readln(fi,cost[x1],need[x1]);
close(fi);
jg:=0;
for x1:=1 to n do
begin
xuyao:=maxlongint;
for x2:=1 to x1 do
begin
ls:=cost[x2]*need[x1]+(x1-x2)*s*need[x1];
if ls<xuyao then xuyao:=ls;
end;
jg:=jg+xuyao;
end;
assign(fo,'factory.out');
rewrite(fo);
writeln(fo,jg);
close(fo);
end.