Bera's blog

By Bera, 9 years ago, In English

I used bitwise operators and normal operators for 319E - Пинг-Понг. The code which i used normal operators didn't get accepted because of memory limit.

The code which i used normal operators. 11337643

The code which i used bitwise operators. 11337611

Can someone please explain this to me?

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

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

I don't know why it happens, but if you change compiler to MS, solution with bitwise operators

11338610 gets AC,

and solution with "normal" operators 11338629 gets ML.

»
9 years ago, # |
Rev. 2   Vote: I like it +75 Vote: I do not like it

Operations /2 and >> 1 don't do the same on odd negative numbers:

-1 >> 1 == -1 and -1 / 2 == 0