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

Автор nobodyknows114, история, 5 часов назад, По-английски

Hello everyone,

I’m curious about how other people approach learning a new algorithm or data structure in competitive programming, especially when it comes to actually retaining it and using it reliably under contest pressure.

When you pick up something new, I’d love to know:

  1. How do you study it so it sticks? Do you read editorials first, trace examples by hand, implement it from scratch without looking at code, or just spam problems until the pattern clicks?
  2. How long does it usually take you to feel master it? Like, from first seeing the idea to being able to spot when to apply it and code it cleanly without silly bugs that a few days, a couple of weeks, or something you revisit over months?
  3. One at a time or multiple at once? Do you stick to one topic until you feel solid before moving on, or do you juggle a few topics in general problem solving so you don't get burned out or overfit to a single tag?

I feel like everyone has a pretty different workflow here, and hearing what actually works for you (and what doesn't) would be super helpful. Thanks in advance!

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

»
5 часов назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I personally think that the best way to improve is to learn until it makes sense for you. So that you can easily connect the dots and come up with a solution (of course it is up to your skills). That's what i prefer and do these days.

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

    Thanks for sharing your perspective. To get to that point where it truly makes sense to you, do you usually try to prove why the algorithm works on your own, or do you rely more on tracing examples and intuition?

    • »
      »
      »
      4 часа назад, скрыть # ^ |
      ← Rev. 2  
      Проголосовать: нравится +7 Проголосовать: не нравится

      Yeah, you must learn in a way that you can teach that topic (e.g. data structures or algorithms) to other people with ease. But I guess you will develop your own approach that is best for you in your journey, just like I did.

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

the description at the start of this blog is literally me every time I learn a new thing, might help: https://codeforces.me/blog/entry/143282

»
3 часа назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
  1. filter codeforces for the topic you are learning
  2. pick the easiest 10 problems
  3. read the first one think about it try all approach come you your mind get some wrong answers / TLE try to understand the gap each time
  4. start reading about the topic from codeforces / topcoder blogs
  5. try to find the topic on my website try both demos and games (https://antinloop.com/)
  6. continue soving the rest of the 10 easiest problems
  7. try more harder problemms.

you need time, be patient... the moments you start feeling pain in your head is the exact moment you are getting better :)

good luck!!

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

    Wouldn’t you want to learn about the topic and what it actually does before solving 10 problems with it?

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

      I would start facing the first problem before learning to at least see challange.

      I remember many years ago when I was solving problems on SPOJ and with a friend we discovered sieve and optimisation like start form the square, and how to effectively do prime factorisation..

      So, yes, I would put my ability on to test first, that makes learning make sense..

»
3 часа назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Depends if you have to learn how the algorithm works or just what it does. For OI you have to understand how to implement it but for CF you lowk just black box it, copy a template and understand what its uses are eg segment tree can do prefix sum but slower with online queries. If you have to understand how it works eg to implement (or if you want to modify mid round like I think I did for a max seg tree) then probably first understand what problem it solves then look up an implementation and just walk through it either with a guide or chat and understand each component. Or use usaco guide my beloved