Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

Автор srlabib, 3 года назад, По-английски

Hi All ! Recently I and turzo_sawroop have done some observations on bitwise operations and found these equations and properties that you may find helpful. I want to share them with you in a nutshell. Here is a shortlist of them:

Some properties of bitwise operations:

  • a|b = a⊕b + a&b
  • a⊕(a&b) = (a|b)⊕b
  • b⊕(a&b) = (a|b)⊕a
  • (a&b)⊕(a|b) = a⊕b

Addition:

  • a+b = a|b + a&b
  • a+b = a⊕b + 2(a&b)

Subtraction:

  • a-b = (a⊕(a&b))-((a|b)⊕a)
  • a-b = ((a|b)⊕b)-((a|b)⊕a)
  • a-b = (a⊕(a&b))-(b⊕(a&b))
  • a-b = ((a|b)⊕b)-(b⊕(a&b))

Hope you like it. Please let me know if you find any issues. All of these properties are elaborated in this blog here. You can also check it out to learn more!

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

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

Third equation is deductible from the second if you apply $$$\oplus a\oplus b$$$ to both sides

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

it is helpful

»
13 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

This is helpful for solving this problem, https://codeforces.net/problemset/problem/1556/D Thank you srlabib and turzo_sawroop!!