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

Автор harsh1919, 4 года назад, По-английски

Hello everyone! I am a beginner in CP and I recently started practicing in Codeforces and Atcoder. So I had this question for a while; Is it bad practice to see failed test cases instead of figuring that out by myself since during actual contests we cannot see that. So I want advice from you guys regarding this because I don't want to get accustomed to bad habits.
Thank you!

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

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

its better to dont see the testcases, but its not really important

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

For my personal opinion , if you think you have tried your level best of the problem but missing some simple corner cases while practicing then you should see the test cases(except sometimes you may face infinite query in test case).The reason is staring at the problem and your approach won't help you much, and it may lead to depression and waste of time which is very bad for cp. And of course it's a bad practice to see frequent test cases but you should know when to give up and go on.

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

It's a good practice

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

Actually not, because for me it costs much time to find where to debug than generate thousands of testcases and debug with that, even when i do contests

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

Being able to figure out what is wrong with your code without looking at test cases is a skill that you will develop over time. When I started out, I would look at test cases whenever I got really stuck trying to find the bug in my code. Nowadays, I'm almost always able to fix my code without looking at the tests. I'd recommend the same approach for beginners: it's okay to look at tests right now if you get really stuck trying to find a bug; over time you should get better and better at finding bugs on your own and accordingly be more strict with yourself about not looking at tests.

Also remember that you can always generate your own tests to run your code on -- this doesn't always work, but sometimes it will (and it's possible to develop a sense for when it might help you find a bug) and you can do this during contests too.

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

I think that initially you should try to find the error without looking at the testcases. But if you are really stuck (that means usually it is a hard problem to you), I would say it is ok to look at the testcases.

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

Guess that’s why I don’t have a higher rating...

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

I am not sure but I usually look up the test case if its possible to see because there may be chances that I am solving the problem in wrong direction considering that to be correct. You can then think of another approach and hence can save time.

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

Well in my case, I try to debug with different test case but when I feel like I have tried my best but not able to find that case then it's better to see test case.

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

From my point of view it's little bit of bad habit but consider these points : 1 — after getting (WA || TLE) read question again and read the constraint again and walk a little while thinking it may happen that some another approach strike; 2 — start making test cases by our own by keeping constraints in mind. the best advice on how to make own test case is think someone else has written code and your task is to hack its solution by giving the worst test cases; (give testcases that can be calculated manually also so we can be sure about the answer) 3 — after spending an 1/2 hour and covering the above two point if still stuck then just see the test case.

note : always try not to see test case as much as possible as that one bit of more thinking to get accepted is always more better then to see testcases and gets accepted;

hope it helps && happy coding.