Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number That Makes Result of Bitwise AND Zero

Try to solve the Maximum Number That Makes Result of Bitwise AND Zero problem.

Statement

Given a positive integer n, find the maximum integer x such that the bitwise AND of all integers from x to n inclusive evaluates to 00.

Constraints:

  • 1≤1 \leq n ≤1015\leq 10^{15}

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number That Makes Result of Bitwise AND Zero

Try to solve the Maximum Number That Makes Result of Bitwise AND Zero problem.

Statement

Given a positive integer n, find the maximum integer x such that the bitwise AND of all integers from x to n inclusive evaluates to 00.

Constraints:

  • 1≤1 \leq n ≤1015\leq 10^{15}