var
f:array[0..100000]of longint;
r,c:array[1..100]of longint;
i,j,k,m,n:longint;
begin
read(n,m);
for i:=1 to n do read(c[i],r[i]);
for i:=1 to n do
for j:=c[i]to m do
if(f[j]<f[j-c[i]]+r[i]-c[i])then f[j]:=f[j-c[i]]+r[i]-c[i];
j:=f[0]+m;
for i:=1 to m do if f[i]+m-i>j then j:=f[i];
write(j);
end.
测评机: Xeond[6]
得分: 80分
提交日期: 2012-2-15 21:52:00
有效耗时: 1359毫秒
测试结果1: 通过本测试点|有效耗时156ms
测试结果2: 测试结果错误.错误结果为:20
正确结果应为:21
测试结果3: 通过本测试点|有效耗时172ms
测试结果4: 通过本测试点|有效耗时156ms
测试结果5: 通过本测试点|有效耗时172ms
测试结果6: 通过本测试点|有效耗时172ms
测试结果7: 通过本测试点|有效耗时156ms
测试结果8: 测试结果错误.错误结果为:432
正确结果应为:433
测试结果9: 通过本测试点|有效耗时157ms
测试结果10: 通过本测试点|有效耗时218ms
for i:=1 to m do if f[i]+m-i>j then j:=f[i];
应为for i:=1 to m do if f[i]+m-i>j then j:=f[i]+m-i;