orz's blog

By orz, history, 11 months ago, In English

Radewoosh inspired me by completing Project Euler, and I recently started, slow but steady, solving its problems. I don't mind anybody adding me as a friend on Project Euler, my friendship key is 2127163_HmDkRoxUDZa38znoBSPq2n4Prg996WEX, please enter it on this page if you're registered and you'd like to see me in your friend list. (Similarly, you'll appear in my friend list.)

I also record the process and upload on Youtube because, according to the rules, problems 1–100 are allowed for public analysis (although I'm afraid there won't be any serious or interesting problems in the first hundred). As for now, uploaded are:

These are screencasts, I would even call them editorials, but (at least in the earlier problems) there isn't exactly much to explain. Watch if you like!

Finally, I really encourage you to register and solve problems as well, if you haven't still!

UPD. Guys, I hate to say this, but Project Euler has an obscure limit of 64 friends max. That means that I cannot add all of you in my friends list.

Therefore, I kinda have to implement some sort of preference and remove people with the lowest one. Some preferences like time of appearance in my friend list sound like trash, so we won't be considering them. Instead I decided to remove people with the fewest problems solved. Currently, at least 24 solved problems are needed. Therefore, if you got deleted and for some reason you want back, just solve a couple of problems and try adding back again!

Spoiler
  • Vote: I like it
  • +229
  • Vote: I do not like it

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by orz (previous revision, new revision, compare).

»
11 months ago, # |
  Vote: I like it +23 Vote: I do not like it

I started grinding ~3 months ago. Right now, I'm doing it casually.

My friend key(in case anyone wants to add me)

The discussion threads are helpful. E.g.

Problem 10
  • »
    »
    11 months ago, # ^ |
      Vote: I like it +39 Vote: I do not like it

    Well, it is even possible to do it in $$$\mathcal{O}{\left(n^{\frac{2}{3}} \log^{\frac{1}{3}}{n}\right)}$$$ time. However, for problems like tenth it is definitely an overkill.

»
11 months ago, # |
  Vote: I like it +19 Vote: I do not like it

If you want to enjoy Project Euler more, try solving some recent problems rather than just old ones.

I’ve added you in my friend list. I look forward to seeing you beat me on the recent problems!

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by orz (previous revision, new revision, compare).

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by orz (previous revision, new revision, compare).

»
11 months ago, # |
  Vote: I like it +14 Vote: I do not like it

Hello, your friend token is invalid

»
11 months ago, # |
  Vote: I like it +8 Vote: I do not like it

Project Euler grind is truly addicting, nice to see more people joining in after that blog from Radewoosh. Nothing like spending weeks on a problem generously marked by PE as "40% difficulty". Worth it, though.

My friend key for anyone interested
»
11 months ago, # |
  Vote: I like it +10 Vote: I do not like it

I don't understand in project Euler how do you know if your approach is good enough. For example the second question (finding sum of even fibonacci numbers below 4 million) can be easily brute forced but the solution shows an expression for just finding the even numbers.

Is the problem expected to just find the answer by whatever means and then show you the better expression on the solution? How do you infer that? How do I know that I don't need a closed-form expression that find the answer on O(1)?

  • »
    »
    11 months ago, # ^ |
      Vote: I like it +46 Vote: I do not like it

    Well, there is a one-minute rule, which allows you to cut too slow solutions off. Beyond this:

    1. Some problems are educational. They usually allow suboptimal solutions, and after you solve it, you can read the attached pdf with some educational stuff, like how you could solve it faster.

    2. After you solve a problem, you have access to the corresponding thread, where people usually share their approaches; so if some of them solved the problem faster than you did, you can read how it could be done.

    Apart from that, during solving the problem, the most stable way to know if your solution can be improved in general is probably your intuition, which comes with experience.

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

If I stuck at particular problem, how can I know what is the solution or idea of that problem??

  • »
    »
    11 months ago, # ^ |
      Vote: I like it +18 Vote: I do not like it

    You cannot. Well, you can search the information in the Internet, or ask your friends, or try another approach. But if nothing helps, the intended by the website admins behavior is to just skip the problem until several days or weeks have passed and you are ready to approach it with new effort.

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

big brainers's blog

»
6 weeks ago, # |
  Vote: I like it -16 Vote: I do not like it

Where to submit or solve Project Euler problems ? There's just a answer box. Where would I put my codes ? I simply don't get it. There're the same problems in freeCodeCamp but it shows error in the console box when I start writing code or simply declaring a variable. It says semicolon is missing in the mid way.

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it +2 Vote: I do not like it

    You have to execute your code locally and just paste the final answer (numerical value) into the " answer box ".

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

orz why you stopped

  • »
    »
    9 days ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I had to spend a lot of time on the preparation to ICPC, so the priority of PE shifted down. After the ICPC it shifted even more. But it would be nice to return back!

»
9 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I'm occasionally grinding PE as well.

My friend key
  • »
    »
    9 days ago, # ^ |
      Vote: I like it +11 Vote: I do not like it

    I also explored solving and proving solutions using Lean theorem prover. For now, it consists of just problem 1.

    • »
      »
      »
      9 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      can i be IGM without solving PE?

      • »
        »
        »
        »
        9 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Of course.

      • »
        »
        »
        »
        8 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Of course. I haven't done a single problem in PE. (Might solve some in the near future, though.)

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it +10 Vote: I do not like it

      Using Lean to prove the solutions sounds like an interesting exercise. I wonder how it'll hold up for the more "computational" problems like Problem 84, though 😅

      • »
        »
        »
        »
        6 days ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I'm not sure how to formally prove that one; the only solution I know is using statistics, which doesn't yield a verified result, and I don't think it can be easily transformed.

        Having said that, there are other kind of "computational" problems (like Problem 83), where you can build the proof while running an algorithm (in this case dijkstra), so the outcome of dijkstra in this case would be both the value, and the proof that the value is optimal.

    • »
      »
      »
      8 days ago, # ^ |
        Vote: I like it +10 Vote: I do not like it

      Woah, this is impressive. I used to have a thought of using Lean to prove time/space complexities of competitive programming problems. (Although I didn't even try.)

      • »
        »
        »
        »
        6 days ago, # ^ |
          Vote: I like it +10 Vote: I do not like it

        I have been thinking about this as well. However, I don't believe Lean is well suited to prove time/space complexities at this point from a given algorithm unless you define the number of steps the algorithm takes in some fancy way.

        The approach I've been considering is implementing some lower-level virtual machine in Lean, maybe something like Knuth's MMIX or RISC. Within the virtual machine context, we can say the time it takes to run is "roughly" the number of instructions executed, and measuring the space should be simple. Then, we can provide proof of programs built for that target.

        But all this looks like a gigantic project far away atm.

»
6 days ago, # |
  Vote: I like it 0 Vote: I do not like it

You should look into doing the hacker rank version of Project Euler, has the same kinds of problems with the same content and general idea, but is more like competitive programming with testcases. I tried a couple and learned a lot!