Tap here to switch tabs
Problem
Submissions

Problem: Maximum Sized Array

Try to solve the Maximum Sized Array problem.

Statement

You are given a non negative integer s.

Consider a three dimensional array A of dimensions nimesnimesnn imes n imes n, indexed from 00 to n−1n - 1, where each element at index (‘i‘,‘j‘,‘k‘)(`i`, `j`, `k`) is defined as:

A[i][j][k] =iimes(jextORk)= i imes (j ext{ OR } k)

where $ ext{OR}$ represents the bitwise OR operator.

Return the maximum integer n such that the total sum of all elements in the array A does not exceed s.

Constraints:

  • 0≤0 \leq s ≤1015\leq 10^{15}

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Sized Array

Try to solve the Maximum Sized Array problem.

Statement

You are given a non negative integer s.

Consider a three dimensional array A of dimensions nimesnimesnn imes n imes n, indexed from 00 to n−1n - 1, where each element at index (‘i‘,‘j‘,‘k‘)(`i`, `j`, `k`) is defined as:

A[i][j][k] =iimes(jextORk)= i imes (j ext{ OR } k)

where $ ext{OR}$ represents the bitwise OR operator.

Return the maximum integer n such that the total sum of all elements in the array A does not exceed s.

Constraints:

  • 0≤0 \leq s ≤1015\leq 10^{15}