tw-icpc-blog |
---|
Public |
Spectator |
Weekly Training Farm 19 |
---|
Finished |
You are given two positive integers a, b. Let us write down all numbers a, a + 1, ..., b in binary. How many 1-bits are there in total?
給定兩個正整數 a, b,若我們將數字們 a, a + 1, ..., b 依序以二進位方式寫下來,請問總共有幾個 1?
The input consists of two positive integers a and b.
輸入僅包含兩個正整數 a, b。
Please output an integer indicating the number of 1-bits.
請輸出一個整數代表有多少個 1。
5 14
23
50 216
675
217 217
5
Name |
---|