sourabh_jangid's blog

By sourabh_jangid, history, 5 years ago, In English

I was trying to solve this problem (56E - Domino Principle). I am stuck on Test Case 30.(Link to my submission 58845497). I tried for hours but not been able to find my mistake. My algorithm is same as the editorial given, but it is giving wrong answer verdict on test case 30. Please help me in debugging the code, and also share some debugging technique, what you use during a contest.

  • Vote: I like it
  • -16
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it -8 Vote: I do not like it

Auto comment: topic has been updated by sourabh_jangid (previous revision, new revision, compare).

»
5 years ago, # |
  Vote: I like it +16 Vote: I do not like it

No, you should debug your programs yourself

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Bro It is not that I didn't tried to debug. I tried it for hour's but I am unable to find the bug. That's why I asked for help.

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      Write a brute force generator, and use the official solution as a checker. You should be able to find a small case that fails.

»
5 years ago, # |
  Vote: I like it +11 Vote: I do not like it

Why would someone waste his time debuging others' codes?

»
5 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Just for fun, I tried something a little gimmicky. I looked for other submissions that got WA on test #30 (by using the status filters). Bubble_Master also got WA on test 30 (on the same output token, too) and then changed their solution slightly and got AC. Maybe you can compare their WA/AC submissions and get a hint about your mistake.