You should think of the time complexity of your algorithms, If you solved problem C small with time complexity n^2 (as I suspect,without looking at your code) It would work well for small input but not for large. Most solutions I saw(including my own) worked in n*log(n) time which is fine for the large input. I think this complexity can be improved upon(maybe) by eliminating symmetries but it is not necessary with the size of the large input. It is easy to estimate if your code will finish in time, n^2 n=~1,000,000 => no good. (actually these numbers are achievable with massive computing power but this is not usually the way to go).
I think the large input was sized wrong, and probably should have been aprox 4 times larger. to make sure inefficient solutions will not finish on time. On Apr 15, 11:55 pm, Balaji Krishna <[email protected]> wrote: > Hey guys, for this problem, I came up with a program for the small > input, and it was relatively fast, certainly less than a minute. I > used the smae algorithm for the large input but then it took about 20 > mins, so was wondering what algorithms you found to work quickest. > > Also, I was wondering if anybody could explain a possible algorithm > for problem d in the same round. > > If you could answer either of these questions, that'll be really > great. Thanks -- 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 this group at http://groups.google.com/group/google-code?hl=en.
