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

Автор joao123, история, 9 лет назад, По-английски

On these days i'm practicing a lot in some OJ, and i always have a little trouble: "When should i give up of thinking and go see the editorial ?".

If you have some tip i would be very thankful.

Sorry for my bad english.

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

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

here is when I read editorial, may not be the best approach :

  1. No clue about question: if I read editorial in this case, I learn something new..

  2. TLE on test cases : if after trying, I can't optimise further, it means I don't know something, so waste of time to try more..

  3. logic/silly/syntax bugs : Not recommend, but if you have already spend 3-4 hours debugging and still fail, its better to look at editorial..

But I have been told, reading code before solving very bad thing before solving a sum, so I avoid that

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

If you cannot solve a problem for a year, probably you don't know something and it is better to read editorial.
Otherwise you should take a break and try to solve another problem. Maybe when you return to this problem after a month you will solve it instantly.

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

If direct road to destination is too long and hard, seek smaller but easier number of paths that leading to that destination.

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

To understand the balance you want to strike, consider the pitfalls on the extreme ends.

If you wait too long before giving up, you will waste time trying to reinvent ideas that you never learned. You'll get to the editorial and realize there's some completely new data structure or algorithm that you haven't seen before. It probably would have been more time-efficient to just read the editorial when you ran out of ideas.

If you give up too quickly, you are missing out on a chance to develop your problem solving ability. Typically when this happens, you'll notice when you get to the editorial that you knew all of the pieces to the solution, and you just couldn't put them together.

I think if you pay attention to when those two issues happen, you can develop an intuition for when to give up on problems.

Also, in general I recommend that you keep working on a problem until you run out of ideas to investigate. For example, maybe you see a problem and you have a few different ideas (greedy approach, max flow, etc.) that seem to be relevant and might lead to solutions. For each idea that you have, try to develop that idea into a full solution, until either you succeed, get stuck, or realize it won't work.

The great thing about doing that is you are developing your intuition for what kinds of approaches work on what kinds of problems, by seeing which ideas succeed and which ideas fail. If you give up too early, and don't follow through on your ideas, you miss all of that learning.