POV-Ray : Newsgroups : povray.off-topic : Project Euler : Re: Project Euler Server Time
11 Oct 2024 13:14:55 EDT (-0400)
  Re: Project Euler  
From: Invisible
Date: 28 Nov 2007 04:28:30
Message: <474d34be$1@news.povray.org>
Mueen Nawaz wrote:
> John VanSickle wrote:
>> I admit that for the C++ solutions I've been resorting to brute force,
>> but for these problems I'm not aware of any solution that avoids the
>> brute force approach.  For instance, in the problem for summing the
>> prime numbers less than one million, I'm not aware of any theorem which
>> calculates such a sum for any range without testing each odd number for
>> primality and then adding the primes.
> 
> 	I've done brute force for a bunch, but at times I try to find
> shortcuts. Sometimes the resulting program is even slower, but I suspect
> it'll scale better.
> 
> 	Also, while a brute force solution in C/C++ may run in under a minute,
> it occasionally will not in Python. So I'm forced to think of ways to
> speed it up. I frequently find a "better" solution than mine in the
> forums, though.

It's interesting how many elaborate problems requiring multiple nested 
loops and filtering take only about 10 instructions in assembly... (!)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.