ashish11's blog

By ashish11, history, 6 years ago, In English

I wrote a solution to https://www.codechef.com/problems/INVENTRY during the Snackdown pre-elimination. The code received verdict WA, so after contest I downloaded several accepted solutions, and tested against randomly generated test cases of various sizes (20-100). In all these cases the answer outputted is the same, and presumably correct given that their codes were accepted.

Since there are only two possible characters, I think almost every non-trivial pattern should occur in my tests, given that I tested over 1e6 cases. It also doesn't appear to err due to the fact that the judging is being done on codechef servers (I tested it on ideone).

Could there be a reasonable explanation to this? I obviously can't prove this, but it seems that for any normal code, all cases where it can fail should also be reproducible on relatively small cases.

Here is my code, if you need for reference : https://www.codechef.com/viewsolution/21437285

Full text and comments »

  • Vote: I like it
  • +9
  • Vote: I do not like it