WhitePaper's blog

By WhitePaper, history, 9 years ago, In English

After trying a problem if I can't find any idea in decent time, I see the editorial or someone else's solution, get the idea and immediately code it and get accepted. Is it okay? Or should I try to solve/code that problem after some days of seeing editorial or someone else's solution? Which is the best strategy to practice programming?

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

| Write comment?
»
9 years ago, hide # |
Rev. 2  
Vote: I like it +11 Vote: I do not like it

I have an idea. I don't think this is the best, but I did the following strategy:

  • Choose a problem which is fit for me, and try it.
  • If I can't find idea though I try to solve the problem for 60+ minutes, I'll see the editorial if I think this is a typical-problem, and otherwise, I'll give up and try 2-3 month later.
  • I solved 20+ problem in my life which is once gave up.

I suggest that especially in concept-hard and imprementation-easy problem ( ad-hoc etc.), if you can't find idea you should give up and solve 2-3 month later because your rating will be increase then.
  • »
    »
    9 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it +5 Vote: I do not like it

    But you're a Candidate Master rated at 2000 ... You're already at a very high level. Hence, spending time thinking on it for an hour will be beneficial for you because you have a toolbox of ideas and strategies to solve the problem ...

    For a beginner, I think it's better to see the solution and practice implementing the solution without bugs because a beginner might not have a wide range of ideas and strategies to try out (unless they had experience in problem solving in some other domain like competition Math) and will most probably only be drawing blanks.

»
9 years ago, hide # |
Rev. 2  
Vote: I like it +8 Vote: I do not like it

My method:-

  1. Try to come up with an approach on my own. Take about 1-2 hours depending on progress made. Maybe about after half an hour, I try googling some things related to the problem.
  2. If I can't think of a solution, I read the first couple lines of the editorial or breeze through the solution of another person to figure which DS/Algo is being used. Then again resume thinking for some more time.
  3. If I still don't have the solution, and I believe I have practised that DS/Algo enough, keep that problem for later. Otherwise, I gather more details from the solution/editorial and think more. And so on. If there is no headway after a long time of thinking, I do read the editorial/solution.

This is because I believe that coming up with a solution or part of it, with or without hints is more beneficial than just coding up a known solution.

There have been many instances where I have solved a problem, months after I first read and thought about it.

Obviously, this method is not applied strictly but this is more or less how I function.

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

I just want to say that when you're just starting out ... there are too many unknown things in competitive programming. You should see the solution when you can't find it and practice implementing the solution. You must get used to border cases and common bugs so you identify mistakes in future, on other judges where test cases will not be visible.

Initially, it is important to know how to implement and become very comfortable in your programming language, because you don't want to be fighting against both the problem and the programming language simultaneously.

The only time when you should continue thinking is when you feel the problem is JUST a little bit out of your hand ... If you feel it's completely hard and you have no idea, then you must not waste time and read the editorial and understand the concept ...

After doing this for about 3-6 months, you will start to get your own ideas creatively :)

And, I started programming in March ...

I posted all my solutions here on GitHub ... The link may be useful to you when you're stuck ... Because I also write about my stumbling blocks and initial bugs. You could follow me if you like :). Since, I am also a beginner like you, you may find similar difficulties.