标签:
1 var 2 i,j,k,l,m,n,t:longint; 3 ll:int64; 4 a,b:array[0..2500,0..2500] of int64; 5 c:array[0..10000] of int64; 6 function max(x,y:int64):int64;inline; 7 begin 8 if x>y then max:=x else max:=y; 9 end; 10 11 begin 12 fillchar(a,sizeof(a),0); 13 fillchar(b,sizeof(b),0); 14 fillchar(c,sizeof(c),0); 15 read(n,m,t); 16 for i:=1 to n do 17 begin 18 read(l); 19 for j:=1 to l do 20 begin 21 read(k); 22 inc(a[i,k]); 23 end; 24 end; 25 ll:=0; 26 for i:=m downto 1 do 27 begin 28 c[i]:=0; 29 for j:=1 to n do 30 begin 31 b[j,i]:=max(b[j,i+1],c[i+t])+a[j,i]; 32 c[i]:=max(c[i],b[j,i]); 33 ll:=max(b[j,i],ll); 34 end; 35 end; 36 writeln(ll); 37 end.
标签:
原文地址:http://www.cnblogs.com/HansBug/p/4175611.html