Flash Flash Revolution: Community Forums

Flash Flash Revolution: Community Forums (http://www.flashflashrevolution.com/vbz/index.php)
-   Technology (http://www.flashflashrevolution.com/vbz/forumdisplay.php?f=74)
-   -   The Project Euler thread (http://www.flashflashrevolution.com/vbz/showthread.php?t=120818)

Reincarnate 05-21-2014 09:06 PM

Re: The Project Euler thread
 
also, honorable mention for just being a really cool and interesting problem with an elegant solution:

http://projecteuler.net/problem=202

axith 05-21-2014 09:13 PM

Re: The Project Euler thread
 
Project Euler makes me feel dumb. I do appreciate the math tidbits that I'm forced to look up though. I had no clue of Euler's Totient function and many number theory ideas before messing with the problems.

leonid 05-21-2014 09:32 PM

Re: The Project Euler thread
 
http://projecteuler.net/problem=144

I still need to solve this one

AutotelicBrown 05-22-2014 04:12 AM

Re: The Project Euler thread
 


Those problems are fun. I'll try 328 later.

stargroup100 05-25-2014 01:50 AM

Re: The Project Euler thread
 
The latest problem, 473, looks really fun. http://projecteuler.net/problem=473

Right after reading it, I feel like finding the phidigital representation of an integer is NP complexity class. However, given the nature of these problems and the limit they ask for, I'm guessing there's some brilliant trick here.

EDIT: PFFFFT the trick was so stupidly obvious im dumb

stargroup100 05-25-2014 03:40 PM

Re: The Project Euler thread
 
This problem is still hard as balls though. The "obvious" algorithm doesn't really help you compute anything efficiently, at least not without some heavy-duty work put onto it.

rushyrulz 05-28-2014 08:29 PM

Re: The Project Euler thread
 
Code:

Problem 17

If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are
3 + 3 + 5 + 4 + 4 = 19 letters used in total.

If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many
letters would be used?

NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains
23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out
numbers is in compliance with British usage.



this one was a recursive nightmare, almost wanted to pencil and paper it.

stargroup100 05-29-2014 02:37 AM

Re: The Project Euler thread
 
Quote:

Originally Posted by rushyrulz (Post 4142267)
Code:

Problem 17

If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are
3 + 3 + 5 + 4 + 4 = 19 letters used in total.

If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many
letters would be used?

NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains
23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out
numbers is in compliance with British usage.



this one was a recursive nightmare, almost wanted to pencil and paper it.

fyi a pencil and paper solution could take less than 10 min LOL

leonid 06-1-2014 01:16 AM

Re: The Project Euler thread
 
That was easier than I feared, but it still took me a couple hours to come up with the right code


leonid 06-1-2014 04:32 AM

Re: The Project Euler thread
 


PARI/GP rocks

leonid 06-1-2014 05:15 AM

Re: The Project Euler thread
 


I'm on fire

stargroup100 06-1-2014 06:32 AM

Re: The Project Euler thread
 
Quote:

Originally Posted by leonid (Post 4143880)


PARI/GP rocks

that thing is fucking amazing

I put it on my phone LOL

leonid 06-1-2014 06:52 AM

Re: The Project Euler thread
 


Used Ruby this time

rushyrulz 06-1-2014 04:54 PM

Re: The Project Euler thread
 
Quote:

Originally Posted by stargroup100 (Post 4142360)
fyi a pencil and paper solution could take less than 10 min LOL

I'm aware, but I am not doing this because I want fast solutions, I'm doing this to strengthen my programming skills.

Just like how problem 19 (how many Sundays occurred on the first day of the month in the 20th century?) could be easily guessed by
Math.round(100*12/7) = 171
, but I wrote a program for it anyway.

Reincarnate 06-1-2014 05:16 PM

Re: The Project Euler thread
 
The first 100 problems are pretty simple

Try some later problems for more of a challenge

rushyrulz 06-1-2014 05:50 PM

Re: The Project Euler thread
 
I'm having a hoot with the first 100 for now D:

igotrhythm 06-1-2014 08:54 PM

Re: The Project Euler thread
 
90% of these have me saying "I wish I knew how to solve this problem period, let alone write a program to solve it."

leonid 06-1-2014 09:23 PM

Re: The Project Euler thread
 


Dynamic programming

leonid 06-1-2014 10:41 PM

Re: The Project Euler thread
 


Another DP
Ruby is slow..

leonid 06-2-2014 12:27 AM

Re: The Project Euler thread
 


~_~


All times are GMT -5. The time now is 06:39 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution