smhh22's blog

By smhh22, history, 6 years ago, In English

Hi. In my system, the output for problem 1077D, TC3 is "1 1", but the judge gives WA, and says my output was "1869767529 546111684". My submission is: 45829660 What's wrong?

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

»
6 years ago, # |
  Vote: I like it +14 Vote: I do not like it

Debug by smell: The output smells like a garbage! Looks for uninitialized variable, out of bound access.
Oh! you have a loop accessing a[i] and then storing it to t. Are you sure that 'i' is within the bound?

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

    Thanks for your help.

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

      its usually a good idea to debug a bugy program

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

        it should also be noted that, it is a bad idea to debug a not buggy program. (who knows, you may create new bugz instead :P)