@dave : correct.. i guess this will work :- sort in decreasing area.
then run LIS such that for i < j , length( i ) > length( j ) && width( i ) > width( j ) On 8/26/12, Dave <dave_and_da...@juno.com> wrote: > @Atul007: No, because a (1,4) tile will not fit on a (2,3) tile. > > Dave > > On Sunday, August 26, 2012 7:45:27 AM UTC-5, atul007 wrote: > >> @kailash : you can simply find area of each slab area=x*y ,,,store it; >> then just run LIS on this area. >> >> On 8/26/12, Kailash Bagaria <kbkailas...@gmail.com <javascript:>> wrote: >> > Yeah Atul is right..... >> > Here is my solution:-- >> > 1) first rearrange the dimensions of slabs i.e. put bigger dimension in >> > >> y >> > and smaller dimenson in x (rotate the slab) >> > 2) then arrange all slabs in increasing order of x dimension >> > 3) and then find the longest increasing sub-sequence based on y >> > dimension...... >> > >> > Ex:- (2,5),(5,1),(1,3),(1,2),(6,1) >> > >> > Step-1=> (2,5),(1,5),(1,3),(1,2),(1,6) >> > >> > Step-2=> (1,2),(1,3),(1,5),(1,6),(2,5) >> > >> > Step-3=> LIS=4 { (1,2),(1,3),(1,5),(1,6) OR >> (1,2),(1,3),(1,5),(2,5) >> > } >> > >> > Correct me if i wrong... >> > >> > On Sun, Aug 26, 2012 at 3:54 PM, atul anand >> > <atul.8...@gmail.com<javascript:>> >> >> > wrote: >> > >> >> its a LIS problem. >> >> >> >> need to think for n-dimension... >> >> >> >> On 8/26/12, Ravi Ranjan <ravi.c...@gmail.com <javascript:>> wrote: >> >> > You are given many slabs each with a length and a breadth. A slab i >> can >> >> be >> >> > put on slab j if both dimensions of i are less than that of j. In >> this >> >> > similar manner, you can keep on putting slabs on each other. Find the >> >> > >> >> > maximum stack possible which you can create out of the given slabs >> >> > >> >> > and for general n-dimesions >> >> > >> >> > -- >> >> > You received this message because you are subscribed to the Google >> >> > Groups >> >> > "Algorithm Geeks" group. >> >> > To post to this group, send email to >> >> > algo...@googlegroups.com<javascript:>. >> >> >> > To unsubscribe from this group, send email to >> >> > algogeeks+...@googlegroups.com <javascript:>. >> >> > For more options, visit this group at >> >> > http://groups.google.com/group/algogeeks?hl=en. >> >> > >> >> > >> >> >> >> -- >> >> You received this message because you are subscribed to the Google >> Groups >> >> "Algorithm Geeks" group. >> >> To post to this group, send email to >> >> algo...@googlegroups.com<javascript:>. >> >> >> To unsubscribe from this group, send email to >> >> algogeeks+...@googlegroups.com <javascript:>. >> >> For more options, visit this group at >> >> http://groups.google.com/group/algogeeks?hl=en. >> >> >> >> >> > >> > >> > -- >> > >> > -- >> > >> > ‘Kailash Bagaria’ >> > B-tech 4th year >> > Computer Science & Engineering >> > Indian Institute of Technology, Roorkee >> > Roorkee, India (247667) >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "Algorithm Geeks" group. >> > To post to this group, send email to >> > algo...@googlegroups.com<javascript:>. >> >> > To unsubscribe from this group, send email to >> > algogeeks+...@googlegroups.com <javascript:>. >> > For more options, visit this group at >> > http://groups.google.com/group/algogeeks?hl=en. >> > >> > >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/algogeeks/-/ABJAgG77YhkJ. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.