Computer Science Canada Project Euler yet again |
Author: | Panphobia [ Tue Jan 01, 2013 6:06 pm ] | ||
Post subject: | Project Euler yet again | ||
I have been doing project euler a lot, it is addicting, I am stuck on making this question solution efficient http://projecteuler.net/problem=148 , I keep getting the java heap space exception or whatever, here is my code
|
Author: | Insectoid [ Tue Jan 01, 2013 6:24 pm ] |
Post subject: | RE:Project Euler yet again |
This is a problem better solved with math than code. They're asking to check the first one billion rows specifically so your solution will not work. I suggest you study Pascal's triangle for a bit to discover any shortcuts you could take. |
Author: | Tony [ Tue Jan 01, 2013 8:47 pm ] |
Post subject: | Re: Project Euler yet again |
Panphobia @ Tue Jan 01, 2013 6:06 pm wrote: BigInteger lol;
This probably doesn't matter to you, but to anyone else reading your code this naming convention works very poorly. |
Author: | Panphobia [ Tue Jan 01, 2013 11:03 pm ] |
Post subject: | RE:Project Euler yet again |
Ohhh yeaa sorry about that, it is kind of a short program, doesn't require it, but it isn't good programming practice I know. |