AtCoder Grand Contest 015
D
A or...or B Problem
AtCoder
⌀ 2655
原题
← CE →
翻译中…

Problem Statement

翻译中…

Nukes has an integer that can be represented as the bitwise OR of one or more integers between $A$ and $B$ (inclusive). How many possible candidates of the value of Nukes's integer there are?

翻译中…

Constraints

翻译中…
  • $1 ≤ A ≤ B < 2^{60}$
  • $A$ and $B$ are integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

A
B

翻译中…

Output

翻译中…

Print the number of possible candidates of the value of Nukes's integer.

翻译中…

样例

Input #1
7
9
Output #1
4
In this case, $A=7$ and $B=9$. There are four integers that can be represented as the bitwise OR of a non-empty subset of {$7$, $8$, $9$}: $7$, $8$, $9$ and $15$.
Input #2
65
98
Output #2
63
Input #3
271828182845904523
314159265358979323
Output #3
68833183630578410
题目信息
题号
agc015_d
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。