I've put all the results in Java Set and if its a repeat. Then I breaked. But this does not a good strategy as I got bugs for large input
On Sat, Sep 12, 2009 at 6:00 AM, NacRuno <[email protected]> wrote: > > In this question how do you define the size of the array to store > previous results while looking for a pattern. During the competition i > thought there is no way to be sure so i set the size of array to 10000 > to be on the safe side. But it took too much time (more than 8 min) > and i missed the question. While doing experiments with my code i > changed the size of the array to 10, it gave me the correct result in > less than 2 minutes. > > Is there a way to prove as few as 10 results would work to decide if a > pattern is found? > > In my case there is no limit to result calculation by the way, i just > store and check the last 10 results with the one i found to see if i > have a pattern. > > > > -- Satyajit --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-codejam" 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 -~----------~----~----~----~------~----~------~--~---
