Блог пользователя Bera

Автор Bera, 9 лет назад, По-английски

I used bitwise operators and normal operators for 319E - Ping-Pong. 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?

  • Проголосовать: нравится
  • +44
  • Проголосовать: не нравится

»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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 лет назад, # |
Rev. 2   Проголосовать: нравится +75 Проголосовать: не нравится

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

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