hint : think it as matrix raised to some power ( then u can compute that in log(n) ) or other way around is to find cycle length . :-)
On Thu, Jun 16, 2011 at 3:56 PM, saurabh singh <[email protected]> wrote: > Very sorry i did used memoization......Ya not possible with o(2^n) > solution...Apologies once again > > > On Thu, Jun 16, 2011 at 3:21 PM, saurabh singh <[email protected]>wrote: > >> Well dont know...My pure recursive solution in python got AC in 0.07s(93 >> bytes).No DP involved.And I don't think python is faster than c? >> > > > > -- > Saurabh Singh > B.Tech (Computer Science) > MNNIT ALLAHABAD > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
