Re: [gcj] optimized algo for LCS0

2012-12-16 Thread ZHANG Xiongqi, Parker
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, th

Re: [gcj] optimized algo for LCS0

2012-12-16 Thread Luís Fernando Dorelli de Abreu
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 > Use brute-force methods to devise an algorithm, then and then, use dynamic > prog

Re: [gcj] optimized algo for LCS0

2012-12-16 Thread Faisal Dirie
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 wrote: > Check the links below. > > http://www.cc.gatech.edu/~ninamf/A

Re: [gcj] optimized algo for LCS0

2012-12-16 Thread Faisal Dirie
Check the links below. http://www.cc.gatech.edu/~ninamf/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 g

[gcj] optimized algo for LCS0

2012-12-16 Thread anupsingh
hey can any one tell me the optimized method of solving LCS problem. I hv optimized still it show TLE... here is the link www.spoj.com/problems/LCS0/ -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To post to this group, send email to google

Re: [gcj] SPOJ - ONEZERO - WA :(

2012-12-16 Thread ZHANG Xiongqi, Parker
Hi thefourtheye dIVi, Basically your idea is correct and this problem can be solved using BFS. However, it is not sufficient to use to solve this problem because the answer to 19998 is 0 which is much larger than the maximum number that could be represente

[gcj] SPOJ - ONEZERO - WA :(

2012-12-16 Thread thefourtheye dIVi
I am trying to solve http://www.spoj.com/problems/ONEZERO/ I referred so many internet posts about this, and they all talk about storing reminders and building a tree. I am running a simple BFS, nothing else... But this gets me WA :( http://ideone.com/SZDn5T Dont know whats wrong with this code.

[gcj] Re: SPOJ buying apples ,Knapsack

2012-12-16 Thread Neolithic
Test cases of the problem are not testing this condition: "he will not buy more than n packets of apples." I got a success without putting check for this condition. On Saturday, 15 December 2012 19:39:34 UTC+5:30, Marti wrote: > > I am having trouble figuring out the reccurrence for the follow