bzoj 1207: [HNOI2004]打鼹鼠 (dp)
var n,m,i,j,ans:longint; x,y,time,f:array[0..10010]of longint; begin readln(n,m); for i:=1 to m do readln(time[i],x[i],y[i]); ans:=1; for i:=1 to m do begin f[i]:=1; for j:=1 to i-1 do if (time[i]-time[j]>=abs(x[i]-x[j])+abs(y[i]-y[j])) and (f[i]<f[j]+1) then begin f[i]:=f[j]+1; if f[i]>ans then ans:=f[i]; end; end; writeln(ans); end.
因疲惫而轻易入眠,是对自己一天努力的最好褒奖。 要和泪子一起努力怀抱梦想对抗残酷的现实……