You should do nothing.
You report that one of other users are reporting you for hacking. So what, who cares?
What I mean is that community moderators will not act without evidence; perhaps you tripped a bug. Perhaps you were just extremely lucky, and submitted an answer moments before the final vote to close the question. Either way, you will not get banned for "hacking" simply due to a bug or other users reporting that you are. You will only be banned if there is actual evidence.
As per what you should do about the possible bug
As it stands, you may very well have encountered a bug. If you can provide links to the original post, with your answer, you should post an actual bug report detailing when and how it happened, and what one might do to reproduce it (if it is, at all, reproducible). This not only helps Stack Exchange ensure bugs like this do not happen again, but if it is not truly a bug, other users will inform you about why it happened.
I personally can't work out the exact details of this case; having a look at your Stack Overflow account, I only see answers listed from as recent as May. You only posted this question 12 minutes ago, so I must assume that the original question has been nuked from the Stack Overflow account, or you are asking on behalf of a friend.1
Looking at your answer, I can determine two facts.
- The question was closed "3 hours ago", with a time stamp of
- You posted your answer "1 hour ago", with a time stamp of
Your answer was posted almost two hours after the question was closed; this is certainly not the intended behaviour, and you should report it as a bug.
1 The user reports this as an issue with Stack Overflow, however, we have since determined that the answer in question was posted at the Math Exchange.