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?

More than 3 years have passed since last update.

yukicoder contest 281 参戦記

Last updated at Posted at 2021-02-05

yukicoder contest 281 参戦記

A 1372 Median of Submasks

MSB(most significant bit) が立つまでと、立った後が同じなので、N の MSB だけ立っているのが答え.

N = int(input())

i = 0
while N != 0:
    N >>= 1
    i += 1
print(1 << (i - 1))
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?