Yes, python is great. But my algorithm for problem C need 4 minutes on my machine. So I was forced to generate all possible answers before downloading large input. I hope, solution like answers = [0,0,1,2,3,...] with commented right algorithm is OK?..)
On Sat, May 22, 2010 at 11:56 PM, Chris Carton <[email protected]> wrote: > That's why I love python. Types are dynamic so if a math operation > overflows the size of an int it simply returns a long instead. :) > > (p.s. long in python is long long in C) > > > On Sat, May 22, 2010 at 4:41 PM, bokertov <[email protected]> wrote: > >> I used "int" and it worked for the small case. But my output for the >> large case was incorrect. Then I found out if I replace "int" by "long >> long", then it's correct! I lost 30 points because of this stupid >> mistake, man! >> >> The reason is that 10^5*10^5 = 10^10, which is bigger than the upper >> bound ~ 2*10^9 of int. >> >> I'll surely learn this lesson, and will avoid it in the future. >> >> -- >> 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]<google-code%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/google-code?hl=en. >> >> > -- > 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]<google-code%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-code?hl=en. > -- Best regards, Дектярев Михаил -- 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.
