Tensor's blog

By Tensor, 9 years ago, In English

I'm solving this problem but there is a little problem for first test case my solution on visual studio returns (2 6) the right answer. after submitting i get wrong answer on test case 1!! getting (1 6) either than (2 6). here is my code please can any one tell me what's the problem?!! thanks in advance!

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

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

Our old friend, the undefined behavior, strikes again! See, for instance, this:

http://stackoverflow.com/questions/11132236/why-does-increment-operation-like-ai-i-result-in-undefined-behavior

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

    thank you, i know what's wrong now :-)