How to solve this problem?

Правка en2, от _humblefool_, 2021-11-21 20:23:19

Given an array A of N elements, you can pick at most one element of the array and increment or decrement it by any value. The task is to maximize the AND of the resulting array.

Note: AND of the array is defined as the bitwise AND(&) of all the array elements.

Constraints: 2 ≤ N ≤ 2 * 10^5 0 ≤ A[i] ≤ 2 * 10^9

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский _humblefool_ 2021-11-21 20:23:19 2 Tiny change: 'N ≤ 2 * 105\n0 ≤ A[i] ≤ 2 * 109' -> 'N ≤ 2 * 10^5\n0 ≤ A[i] ≤ 2 * 10^9'
en1 Английский _humblefool_ 2021-11-21 20:22:08 342 Initial revision (published)