1270: [BeijingWc2008] Leitao kitten time limit:50 Sec Memory limit:162 MB
submit:905 solved:430
[Submit] [Status] Description Inputoutputsample InputSample Output8HINT
Source
The sum: What about this? First declare-this procedure in Bzoj hand over each time is inexplicable re, but I want to data after the window under the test how to measure no problem, the amount, I beg you also help me find the wrong ... OK, the idea is as follows-this problem is a comparison of water DP, that is, for each tree point, this point can have two ways to value--1. Jump directly above the same tree. 2. Jump off the delta above any other tree. Then the value of the current point is max (just above each other tree above the delta) + the number of Persimmon in the current position ... So a problem arises--what we need is the delta grid above the other trees, not the tree, which seems to be difficult to deal with, and I even thought of moving out of the splay. You can find another problem--because delta>0 (phile: The topic is not said Hansbug: that is, if delta=0 that is not all the persimmon can be eaten casually ah =), so it is easy to prove to the same tree, The point below is unlikely to be smaller than the one at the top, which means that the value of the delta above the same tree will not have any effect on the result even if it is in the max value of that height-obviously, the position of the top delta is even more than a lattice above, That's not true. Nothing else.
1 var2 I,j,k,l,m,n,t:longint;3 Ll:int64;4B:Array[0..2500,0..2500] ofInt64;5C:Array[0..10000] ofInt64;6 functionMax (X,y:int64): Int64;inline;7 begin8 ifX>y ThenMax:=xElsemax:=y;9 End;Ten One begin AFillchar (A,sizeof (a),0); -Fillchar (b,sizeof (b),0); -Fillchar (C,sizeof (c),0); the read (n,m,t); - fori:=1 toN Do - begin - read (l); + forj:=1 toL Do - begin + read (k); A Inc (A[i,k]); at End; - End; -ll:=0; - forI:=mDownto 1 Do - begin -c[i]:=0; in forj:=1 toN Do - begin toB[j,i]:=max (b[j,i+1],C[I+T]) +A[j,i]; +c[i]:=Max (c[i],b[j,i]); -ll:=Max (B[J,I],LL); the End; * End; $ Writeln (ll);Panax Notoginseng End.
1270: [BeijingWc2008] Leitao's Kitten