Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: November 5, 2026, 2:10 am
Thread Rating:
|
Project Euler
|
|
Oooh... I like.
I solved the first two pretty quickly. Using C++. RE: Project Euler
June 26, 2016 at 4:39 am
(This post was last modified: June 26, 2016 at 4:39 am by GrandizerII.)
Seriously, these are fun and challenging.
Usually, my code is pretty hacky because I don't care about anything but the result, but I love these challenges. (June 28, 2016 at 4:58 am)SteelCurtain Wrote: Seriously, these are fun and challenging. Where you up to, Steel? If by hacky, you mean running fragments of code, extracting the intermediate answers, and then using those answers as part of the data for the final code, then yep, that's what I did for a couple of them thus far.
I'm working on #12 right now.
I'm on a slow shitty computer at work using Python and IDLE now. The summation of primes problem was too much for the online shells, they time out after like 5 seconds, the stingy bastards. Hard to sum all of the primes below 2,000,000 in 5 seconds with an online shell. Now I am finding all of the divisors in triangle numbers, finding the first triangle number with more than 500 divisors. The code was easy, but it's been running for quite a time. I've tried to make it as economical as possible, but I don't care to think too hard about it. ![]() That's what I mean by hacky: maybe not the most efficient code, and that's why this is good practice. I am trying to loop as few times as possible when having nested loops running two million times. (July 3, 2016 at 1:52 am)SteelCurtain Wrote: I'm working on #12 right now. Can I give you a hint on how to deal with primes in the case of very large numbers?
Sure!
To be clear, I didn't actually loop through every number. I skipped evens, and I didn't check for factors after 1/3 of the number I was checking. |
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| [Euler] Need clarification | shadowdancer | 11 | 6550 |
November 22, 2011 at 2:17 am Last Post: shadowdancer |
|
Users browsing this thread: 1 Guest(s)



