Блог пользователя Omar_Hafez

Автор Omar_Hafez, история, 4 года назад, По-английски

Hello, I am new to competitive programming and when I learn a new technique or algorithm I really don't know is it important to understand why this algorithm work or what is the math behind this algorithm ? or just I need to understand how it works and how to use it to solve the problems that this algorithm or technique fit in?

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

»
4 года назад, # |
Rev. 2   Проголосовать: нравится +21 Проголосовать: не нравится

As a beginner , the major algorithms that you will require are binary search and prefix sums and............yeah that is pretty much it. Rest is all greedy, observations, math and sometimes combinatorics. That is all. As far as binary search and prefix sums are concerned, yes, you should get into their depths, these two are frequently used, doesn't matter if you are a div 1 or div 2 participant. For stuff like dp,yeah perhaps understanding how to write dp states and transitions is helpful,although you won't encounter too many dp problems as a beginner.As you gain experience,you may require more algorithms, but that is something that is better learnt while practising and spending time on harder problems

»
4 года назад, # |
Rev. 2   Проголосовать: нравится +6 Проголосовать: не нравится

To get out of newbie rank, I think all one needs is decent math background (ie 80+ AMC score) and basic programming ability. I was ~1200 while knowing practically no algorithms but being an AIME qualifier.

I would say algorithms aren't really necessary to get out of newbie.

But when you do learn an algorithm, of course you should know why it works, the math behind it, etc. Codeforces is extensions of algorithms, not just copy-paste [algorithm].

»
4 года назад, # |
  Проголосовать: нравится -31 Проголосовать: не нравится

In a interview it is better to explain it to the person interviewing you, on codeforces being good is just about having good tempelates.

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится -11 Проголосовать: не нравится

    Why was I downvoted?

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Because an unhelpful sarcastic answer to a genuine question is what downvotes are meant for.

      • »
        »
        »
        »
        4 года назад, # ^ |
        Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

        aree tere bhai ke pas coding interview me experience hai that is why I say for coding interviews prep you need to learn everything completely but for cf u dont really need to have that deep of a understanding of many advanced topics because they are mostly used as tools. For example, segment trees, you dont need to learn how it works just need to know how/when to use them.

        • »
          »
          »
          »
          »
          4 года назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится

          codeforces is not a coding interview preparation site, kindly keep your advice to yourself.

»
4 года назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

if the goal is to become a better problem solver then I think it is more important to understand why an algorithm works than being able to fit it in places.

try proving algorithms(if not a rigorous mathematical proof at least a proof that you can convince yourself with), this helps you in becoming a better problem solver + makes you more capable of designing your own algorithms.

so yep according to me understanding why "it" works is super important.