When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

Kognition's blog

By Kognition, history, 4 years ago, In English

I think everyone here knows the general formula for improvement: do problems that are not too easy and not too difficult for you. Now, when implementing this in practice, one comes across the very difficult and often-asked question, "How long do I try before giving up and looking at part of the solution?"

I have seen various answers for this question, ranging from days to hours to once where I saw some red guy advocate for 5-10 minutes. It seems as though the median time I've seen advocated is somewhere around 30-45 minutes.

But the 5-10 minutes comment got me wondering: has anyone ever tried using a time threshold of 0 minutes? As in, you just read problems that are not too easy and not too difficult for you, and just immediately look at the solution, try to understand it, and implement it? And then repeat this for say, 20-50 problems, and recalibrate what is too easy/too difficult by competing in contests? Intuitively it feels like the progress should not be as high as if the parameter was 30-45 minutes, but it would be interesting to hear whether anyone has done this, and what the results were.

  • Vote: I like it
  • +30
  • Vote: I do not like it

| Write comment?
»
4 years ago, # |
  Vote: I like it -10 Vote: I do not like it

I did it for 3-4 months(daily 3-4 problems) back when I was a specialist, and ya It didn't amount to sh*t.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Interesting. To be clear, you did the due diligence of making sure you actually understood the solutions, and implemented them?

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +38 Vote: I do not like it

      Yes I did understand and implement. But the reason I failed is -

      Knowing just the right way to do a problem is not enough, you need to understand how not to do it as well (Which comes only by thinking on your own for longer times).

»
4 years ago, # |
  Vote: I like it +9 Vote: I do not like it

I did something similar in the very very beginning of my CP practice: I read through a short book (in Russian) with the bunch of super simple problems, techniques and explanations of them. I found it all very interesting and helpful as an exposure to the CP and types of problems/techniques it has.

Later I read through another book (in Russian as well) with much harder problems, and failed to solve something like ~80% of them (I didn't know anything about DP or how to quickly check if the number is prime, for example). So I read the editorials to the problems rather quickly, and they were well written and taught me a lot.

So I think this may be very helpful in the beginning, when you need to pick up a lot of well known techniques and algorithms. Or if you want to learn a particular algorithm, you can read about a lot of problems related to it. At my current level this doesn't seem to work well in general case, because harder problems are mostly ad-hoc and creative, rather than testing the algorithms/techniques I don't know.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Can you tell books' names ?

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      I don't remember the first one, but the second one is this: link (in Russian). You can solve the problems from the book for example here: link

»
4 years ago, # |
  Vote: I like it +27 Vote: I do not like it

If you want to read without trying to solve, read general resources: textbooks, specific algorithm tutorials and such. Don't waste good problems on this.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Your book, explaining algorithms using metaphors is a really good one, would you recommend to read algos from a book like that and then solve problems? Or just solve problems and learn algos as and when needed?

    By the way, It would be so amazing if more algorithms are covered, your way of teaching is great (Like maybe intuition about various types of DP and graph theory topics)