vj1153 猫狗大战

Vj1153 - /dp f[i,j,k i j j/f[i,j,k]=f[i-1,j-1,k-a[i or f[i-1,j,k(1<=i<=n const maxn=200 maxv=4000 var n,sum:integer a:array[0.maxn of integer

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //dp //Éè f[i,j,k] Ϊǰ i ¸öÈËÖÐÈ¡ j ¸öµÃµ½ºÍΪ j µÄ¿ÉÄÜÐÔ //f[i,j,k]=f[i-1,j-1,k-a[i]] or f[i-1,j,k] (1<=i<=n 1<=j<=n>>1) / const maxn=200; maxv=4000; var n,sum:integer; a:array[0. .maxn] of integer; f:array[0. .maxn,0. .maxv] of boolean; procedure init; var i:integer; begin readln(n); for i:=1 to n do begin readln(a[i]); inc(sum,a[i]);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/21/2011 for the course CS 001 taught by Professor 001 during the Spring '11 term at Shandong University.

Ask a homework question - tutors are online