Page 3 of 3

Re: Problem 020

Posted: Sun Nov 20, 2011 2:20 am
by bld
158 digits is not a very big number. everyone can solve this but i'm hoping for an amazing solution in the overview.pdf . So i should make my code now (haven't solve this problem yet !)

Re: My Solution Euler Problem 20

Posted: Fri Apr 27, 2012 1:13 am
by dan_misailescu
This is my first post on this forum so hello everyone!

Salutări din România!
Greetings from Romania!

I'm new to the site, This is only my 15-th solved problem.

I'm happy I solved Project Euler Problem 20 elegantly, and with it I also created a special Project Euler C# Library with Classes that will help me with future Project Euler problems. And as I discover algorithms I want to add to it more and more.
I suggest you do the same so that you don't repeat the same work over and over again.
For now I have the means to sum and multiply numbers however big.


My algorithm for 100! worked in {00:00:00.0619568}
SO ALMOST INSTANTLY :)

I'm not writing it all, so that you don't directly compute the sum of all the digits on the screen :) and input the result on Project Euler.

For maths sake I decided to use it also for computing the monstrous 1000!... It didn't take long, considering how huge the number is. Only {00:03:34.9686380}

The result was this:

snip

I'm sure by now you wonder about the details behind my "misterious" BigNumberClass...
In short, I used the idea to compute the product digit by digit, just like we compute products on a sheet of paper.

The complete code I created is available on ProjectEuler special thread for the problem 20 and you can see it there once you solve it yourself.
I don't want to spoil you the pleasure of solving it yourself :)


Cheers!
Dan Misailescu

Re: Problem 020

Posted: Fri Apr 27, 2012 3:28 am
by rayfil
@ Dan,

You should certainly be proud of your accomplishments. However, please restrict publishing your code and results in the problem threads on the other site. This forum is NOT for that purpose.