border's blog

By border, 5 years ago, In English

submission 1 submission 2

Is it because of the bitwise operators? If so, why?

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

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

Seeing that there is quite some time between these two submissions, this is probably a difference in the way memory usage was measured by the judge. If you submit your older solution again you should get the same memory usage. See here.

The only difference between bitwise and modulus operator is in their behavior for negative numbers, otherwise the compiler would directly replace the modulus by a single bitwise operation. It does so if you check for even numbers. So there's no reason this would have a notable effect on memory usage.