1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

競プロ日記#25/05/06

Posted at

アルゴ式

Q8. スイッチクエリ (2)

  • スイッチのoffについて思いつかなかったので勉強になった
// (S = S & ~(1 << x))でSのxビット目を0にすることができる。
// 1 << xはxビット目が1でそれ以外が0の数を表す。
// 1 << xのビットを反転させるとxビット目が0でそれ以外が1の数になる。
if (flag == 1){
    (S = S & ~(1 << x));
}

Ex. XOR の意味

  • A XOR B = CのときA XOR C = Bになる
1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?