One day you came up with a brilliant solution during a contest, implemented it very carefully, and submitted it confidently. The verdict was ...... WA.
Probably most of you have experienced this sad situation. You can start debugging if you know the reason of WA, but what do you do otherwise? I frequently have trouble with this situation, so I'd like to ask your opinion. What should we do when we get WA?
Here are several possibilities:
1. Reread your code.
This is the simplest way of debugging. You may find some stupid typos.
2. Try various manual testcases.
Examples may not be very strong. Try some small tricky cases against your code.
3. Recheck the correctness of your algorithm.
Have you proved your solution? Is the proof correct?
4. Reread the statement.
You may have misunderstood the statement. Read it again to make sure that you understood the task correctly.
Write a straightforward solution, create lots of testcases by yourself, and compare both solutions. This is a very strong way to debug your solution, but time consuming.
6. Change the coder.
When you compete as a team, ask someone else to solve the problem instead.
7. Doubt the judge.
Judges are humans. They are not 100% correct.
8. Give up.
You may have other tasks to solve. Simply give up the current task and try something else.