Reply to topic  [ 113 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8
Project Euler 
Author Message
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
BOOM!

Level 2!

50 problems solved.

I went back to problem 96 and used my app to solve them one by one. It's not cheating as I wrote the app that solved them :D

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Wed Jan 18, 2012 3:35 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
Solved problem 49 now also :D

Some of the problems are so easy to understand and relatviely easy to work out how a program might solve it but they are a ball ache to program them. Parsing numbers into strings or reading text files into variables and analysing them etc...

TBH I tend to pass by them if I think they're going to be like that. This is one I decided to try despite that fact.

Now ranked 625th in the country out of 3792.

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Thu Jan 19, 2012 10:45 am
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
Question 76 done :D

How many ways can 100 be written as a sum of at least two positive integers?

It's a lot!

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Fri Jan 20, 2012 10:06 am
Profile WWW
Has a life

Joined: Tue Jan 17, 2012 11:41 am
Posts: 2
Reply with quote
FC 15193338300428_e6788f09d37de98dd5aef38f64ea3386


Sun Jan 22, 2012 4:42 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
Problem 41 - find the largest n-pandigital prime number.

SOlved, runs in 0.2 seconds in C++.

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Thu Feb 02, 2012 1:10 pm
Profile WWW
Spends far too much time on here
User avatar

Joined: Thu Apr 23, 2009 9:40 pm
Posts: 4876
Location: Newcastle
Reply with quote
Fogmeister wrote:
Problem 41 - find the largest n-pandigital prime number.

SOlved, runs in 0.2 seconds in C++.

0.343 seconds for me in C#, could really optimise it but don't see much point, it is on a work machine doing a lot of other things though

Ended up splitting out the concerns to a subset of numbers once I figured out the number of digits it had to have, the whole answer runs on 1 line of code calling 2 methods previously used

_________________
Twitter
Charlie Brooker:
Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.


Thu Feb 02, 2012 2:43 pm
Profile
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
finlay666 wrote:
Fogmeister wrote:
Problem 41 - find the largest n-pandigital prime number.

SOlved, runs in 0.2 seconds in C++.

0.343 seconds for me in C#, could really optimise it but don't see much point, it is on a work machine doing a lot of other things though

Ended up splitting out the concerns to a subset of numbers once I figured out the number of digits it had to have, the whole answer runs on 1 line of code calling 2 methods previously used

Mine was almost brute force but not quite.

I can say that the maximum must be less than 7654321 as any number that is 8 or 9 pandigital is divisble by 9.

I used a sieve to get all the primes up to 7654321 and then went through them in reverse to find the first (or last) pandigital one.

Once I'd found it that is the highest.

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Mon Feb 20, 2012 4:49 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
Oh, also solved problem 40 now.

This was one I had thought about doing on paper but it got messy. In the end a really simple bit of code did it for me.

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Mon Feb 20, 2012 4:50 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 113 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.