Hi, I've encountered this problem in a contest which is already over, so I'd like to share it and see if you have any solution.↵
I've been trying for about a week and still haven't found any good dp or backtracking solution.↵
↵
Given array $a$ of $n$ integers, divide it into $m$ non-empty subarray so that bitwise or of sums of subarrays is maximal. Print maximal or. ↵
↵
↵
$1 \leq n, m \leq 50$ ↵
$1 \leq a_i \leq 2^{50}$↵
↵
Time limit is 0.4 sec
I've been trying for about a week and still haven't found any good dp or backtracking solution.↵
↵
Given array $a$ of $n$ integers, divide it into $m$ non-empty subarray so that bitwise or of sums of subarrays is maximal. Print maximal or. ↵
↵
↵
$1 \leq n, m \leq 50$ ↵
$1 \leq a_i \leq 2^{50}$↵
↵
Time limit is 0.4 sec