The concatenating of list(si) would have a size of O(mn) at worst case and even the O(n logn) algorithm for solving the longest increasing subsequence will not be fast enough.

Please tell me I am wrong. =w=

Parker

On 2012/12/17 9:28, Luís Fernando Dorelli de Abreu wrote:
Given the limits, those ideas are going to TLE I guess.
You can get an idea of a reduction that might work here : http://www.cs.ucf.edu/courses/cap5510/fall2009/SeqAlign/LCS.efficient.pdf


2012/12/16 Faisal Dirie <[email protected] <mailto:[email protected]>>

    Use brute-force methods to devise an algorithm, then and then,
    use dynamic programming techniques to tweak your code to achieve
    an optimized one, depending on what you want to do.


    On Sun, Dec 16, 2012 at 6:20 PM, Faisal Dirie <[email protected]
    <mailto:[email protected]>> wrote:

        Check the links below.

        http://www.cc.gatech.edu/~ninamf/Algos11/lectures/lect0311.pdf
        <http://www.cc.gatech.edu/%7Eninamf/Algos11/lectures/lect0311.pdf>


        
http://en.wikibooks.org/wiki/Algorithm_implementation/Strings/Longest_common_subsequence


-- You received this message because you are subscribed to the Google
    Groups "Google Code Jam" group.
    To post to this group, send email to [email protected]
    <mailto:[email protected]>.
    To unsubscribe from this group, send email to
    [email protected]
    <mailto:google-code%[email protected]>.
    For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups "Google Code Jam" 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 https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups "Google 
Code Jam" 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 https://groups.google.com/groups/opt_out.


Reply via email to