It's because of this that Python is useful for these types of problems as it
takes care of these problems for you.

It might make for a slightly slower program, but with the right algorithm
it's fast enough.

Now, if only I could write the programs faster I might have a chance with
round 1C :-)

Abizer.

On 22 May 2010 20:50, Ralph Furmaniak <[email protected]> wrote:

> Another good lesson to take from this is to always look at your output
> before submitting, for a basic sanity-check.  When I ran my program on
> the large input and saw the negative numbers, I realised that I had to
> change my ints to long longs before submitting :-)
>
> On Sat, May 22, 2010 at 12: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.
>
>


-- 
Abizer

-- 
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.

Reply via email to