The Project Euler thread

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stargroup100
    behanjc & me are <3'ers
    FFR Simfile Author
    FFR Music Producer
    • Jul 2006
    • 2051

    #286
    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.
    Rhythm Simulation Guide
    Comments, criticism, suggestions, contributions, etc. are all welcome.

    Piano Etude Demon Fire sheet music

    Comment

    • rushyrulz
      Digital Dancing!
      FFR Simfile Author
      FFR Music Producer
      • Feb 2006
      • 12985

      #287
      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.


      Comment

      • stargroup100
        behanjc & me are <3'ers
        FFR Simfile Author
        FFR Music Producer
        • Jul 2006
        • 2051

        #288
        Re: The Project Euler thread

        Originally posted by rushyrulz
        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
        Rhythm Simulation Guide
        Comments, criticism, suggestions, contributions, etc. are all welcome.

        Piano Etude Demon Fire sheet music

        Comment

        • leonid
          I am leonid
          FFR Simfile Author
          FFR Music Producer
          • Oct 2008
          • 8080

          #289
          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




          Proud member of Team No

          Comment

          • leonid
            I am leonid
            FFR Simfile Author
            FFR Music Producer
            • Oct 2008
            • 8080

            #290
            Re: The Project Euler thread



            PARI/GP rocks



            Proud member of Team No

            Comment

            • leonid
              I am leonid
              FFR Simfile Author
              FFR Music Producer
              • Oct 2008
              • 8080

              #291
              Re: The Project Euler thread



              I'm on fire



              Proud member of Team No

              Comment

              • stargroup100
                behanjc & me are <3'ers
                FFR Simfile Author
                FFR Music Producer
                • Jul 2006
                • 2051

                #292
                Re: The Project Euler thread

                Originally posted by leonid


                PARI/GP rocks
                that thing is fucking amazing

                I put it on my phone LOL
                Rhythm Simulation Guide
                Comments, criticism, suggestions, contributions, etc. are all welcome.

                Piano Etude Demon Fire sheet music

                Comment

                • leonid
                  I am leonid
                  FFR Simfile Author
                  FFR Music Producer
                  • Oct 2008
                  • 8080

                  #293
                  Re: The Project Euler thread



                  Used Ruby this time



                  Proud member of Team No

                  Comment

                  • rushyrulz
                    Digital Dancing!
                    FFR Simfile Author
                    FFR Music Producer
                    • Feb 2006
                    • 12985

                    #294
                    Re: The Project Euler thread

                    Originally posted by stargroup100
                    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.
                    Last edited by rushyrulz; 06-1-2014, 04:06 PM.


                    Comment

                    • Reincarnate
                      x'); DROP TABLE FFR;--
                      • Nov 2010
                      • 6332

                      #295
                      Re: The Project Euler thread

                      The first 100 problems are pretty simple

                      Try some later problems for more of a challenge

                      Comment

                      • rushyrulz
                        Digital Dancing!
                        FFR Simfile Author
                        FFR Music Producer
                        • Feb 2006
                        • 12985

                        #296
                        Re: The Project Euler thread

                        I'm having a hoot with the first 100 for now D:


                        Comment

                        • igotrhythm
                          Fractals!
                          • Sep 2004
                          • 6535

                          #297
                          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."
                          Originally posted by thesunfan
                          I literally spent 10 minutes in the library looking for the TWG forum on Smogon and couldn't find it what the fuck is this witchcraft IGR

                          Comment

                          • leonid
                            I am leonid
                            FFR Simfile Author
                            FFR Music Producer
                            • Oct 2008
                            • 8080

                            #298
                            Re: The Project Euler thread



                            Dynamic programming



                            Proud member of Team No

                            Comment

                            • leonid
                              I am leonid
                              FFR Simfile Author
                              FFR Music Producer
                              • Oct 2008
                              • 8080

                              #299
                              Re: The Project Euler thread



                              Another DP
                              Ruby is slow..



                              Proud member of Team No

                              Comment

                              • leonid
                                I am leonid
                                FFR Simfile Author
                                FFR Music Producer
                                • Oct 2008
                                • 8080

                                #300
                                Re: The Project Euler thread



                                ~_~



                                Proud member of Team No

                                Comment

                                Working...
                                  Notice: Function utf8_encode() is deprecated in phar://.../vb/vb.phar/mail/transport/legacy.php on line 2 Notice: Function utf8_encode() is deprecated in phar://.../vb/vb.phar/mail/transport/legacy.php on line 2 Warning: Undefined variable $username in phar://.../vb/vb.phar/mail/transport/legacy.php on line 2 Notice: Function utf8_encode() is deprecated in phar://.../vb/vb.phar/mail/transport/legacy.php on line 2 Notice: utf8_encode(): Passing null to parameter #1 ($string) of type string is deprecated in phar://.../vb/vb.phar/mail/transport/legacy.php on line 2 Notice: Function utf8_encode() is deprecated in phar://.../vb/vb.phar/mail/transport/legacy.php on line 2