Or

3.6

49 votes
Operators, Math, C++, Basic Math
Problem

Problem Statement:

how many distinct numbers can be generated by doing bitwise OR of one or more integers between A and B (inclusive)?

Input Format:

input contains two integers A and B

Output Format:

Print the number of possible Integer that can be genrated .

Constraints :

  • 1≤AB<260
  • A and B are integers.
Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

In this case, A=7 and B=9. There are four integers that can be generated doing the bitwise OR of a non-empty subset of {7, 8, 9}: 7, 8, 9 and 15

Editor Image

?