Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number That Makes Result of Bitwise AND Zero

Maximum Number That Makes Result of Bitwise AND Zero asks you to find the largest starting integer such that the bitwise AND of every number from it through n is zero.

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

Maximum Number That Makes Result of Bitwise AND Zero asks you to find the largest starting integer such that the bitwise AND of every number from it through n is zero.

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}