摘要:
1.0/1背包var v,p:array[0..1000] of longint; f:array[0..100000] of longint; n,m,i,j:longint; function max(a,b:longint):longint; begin if a>b then exit(a); exit(b); end;begin readln(n,m); for i:=1 to n do readln(v[i],p[i]); for i:=1 to n do for j:=m downto v[i] do f[j]:=max(f[j],f[j-v[i]]+p[i]); writ 阅读全文
摘要:
NOIP在即,暑假还剩半月,是时候好好整理下基础知识了.forward~. 阅读全文