1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

競技プログラミング用のXORの性質

Posted at

はじめに

AtCoderのXOR (排他的論理和)の問題を解く時に使う性質をメモします。

XORの性質

x ^ y = y ^ x //交換則
x ^ x = 0 //自分自身は0になる
x ^ 0 = x //0を作用させても変わらない
(2*a) ^ (2*a + 1) = 1 //任意の偶数について成り立つ

まとめ

XORの演算をメモしました。
これ以外で重要な性質があったら、随時書き足します。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?