bazsi700's blog

By bazsi700, history, 7 years ago, In English

When I'm solving problems in practice section, and I keep getting WA/TLE on some case, I usually peek on the test case which I failed, so I can find the bug in my code, or realize my solution is wrong.

Should I keep doing it, or it ruins the practice? (So I won't get better if I use it)

  • Vote: I like it
  • -2
  • Vote: I do not like it

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

It's generally bad.

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

This question has definitely been asked plenty of times before, so I'll try to give a short response.

1.) If you are virtually participating as part of your practice, you should not "cheat". The purpose of virtual contests is to do its best to replicate the actual contest environment. If you take advantage of it and look at the answers then it ruins that spirit.

2.) If you are outside of an actual contest, then it's really up to your best judgement. Everyone is different, but the general consensus is that you should give it a few days to simmer on it before looking at solution guides or test cases. You might be able to rationalize why your solution is right/wrong and come up with bug fixes on your own. This self teaching will develop your programming skills during a contest, which can't be said for sure about simply checking the solutions as soon as you get frustrated. It is navigating through your frustration to find success which develops skill. However, some times just thinking about a problem in the background doesn't ever come to anything. It's at this point, after a few days of considering it that I would say you should return and look at the test cases.

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I don't think it's a good habit to do that.Because in ACM-ICPC contests and Codeforces contest,you aren't able to see the test input.(SORRYFORMYPOORENGLISH)

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

    If you want to find bugs in your programme,you should create some test cases by yourself.And I suggest you to pay attention to your algorithm's time complexity so that you will get less TLE.