Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

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

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

If i am getting a WA verdict on pretest what are the techniques I need to follow

If I know the logic of how to solve the question but due to code error

if i'm getting WA verdict are there any general techniques followed to find out the error correctly.

PLease share your techniques with me.

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

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

Try to find a test case using Random test cases

»
4 года назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится
  • Write a very naive and simple solution to the problem (maybe exponential complexity) (if you can, you may also just copy someone else's solution)
  • Write a program to generate thousands of small (!) test cases
  • Using those two, find a test case where your program gives the wrong answer
  • Use print statements or a debugger to see where exactly your program does the wrong thing.