### YandereDev's blog

By YandereDev, history, 5 months ago,

I'm new to competitive programming and I'm wondering if you guys memorize or write down the algorithms that you learned. Thanks for the answer.

• +12

 » 5 months ago, # |   +3 Auto comment: topic has been updated by YandereDev (previous revision, new revision, compare).
 » 5 months ago, # |   0 u dont have to memorize any algorithms if u dont want to. Its all about the practise. The more u practise the more it will easier to remember the techniques
 » 5 months ago, # |   0 I often memorize them, but sometimes I face a beautiful problem with strange observations, such as 1473G - Tiles, I will write it down and keep it in a notebook, so I can read it everywhere~
 » 5 months ago, # |   0 The first thing is you need to understand the whole details of each step of the algorithm that how it works and why it works. Then the next step involves to solve problems that use that particular algorithm. Hence this way, you again and again write down the code for the same algorithm such that it becomes your muscle memory which is the desired outcome.For sure, this would not happen in just first/second try. Lets take an example of binary search. maybe for the first time you may write the never terminating loop. But this would for sure improve each time you write the code for it.So, in short we do memorize and write down the algorithms we have learned. Wish you luck forward :)
 » 5 months ago, # |   0 All you need is logic. I was using kadane's algorithm even before I know there is a algorithm names kadane. Same with greedy and dynamic programming algorithms. Don't decide which algorithm to use just approach the solution with most basic logic you can think. You will be surprised to see that you used DFS, binary search and many other algorithms unknowingly.
 » 5 months ago, # | ← Rev. 2 →   +25 I understand them way more often than just memorizing... the only data structure/algorithm I remember memorizing and not understanding how it works for a long time was fenwick tree. There are other things like simplex that I don't understand how it works but that's not commonly used at all so it didn't come into mind when first writing this comment.