HitmanBBa's blog

By HitmanBBa, 8 years ago, In English

Peace,

In today's contest problem B, I tried to hack this solution 19690271, but all my 4 attempts where unsuccessful, then I decided to automate the hacking process with writing C++ code to try large random input on 2 versions of this code one with long and one with int but unfortunately 30 minutes without any break in the infinite loop which search for the test case, so I will be very thankful to the person who would explain to me why?

Tags c++
  • Vote: I like it
  • -3
  • Vote: I do not like it

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

Suppose value of sum = INT_MAX i.e. 2147483647 (ODD)

Add 1 to it

Actual value = 2147483648 (EVEN)

Sum value = -2147483648 (EVEN)