Vovkaez's blog

By Vovkaez, history, 9 days ago, In English

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 and of sums of subarrays is maximal. Print maximal and.

$$$1 \leq n, m \leq 50$$$ $$$1 \leq a_i \leq 2^{50}$$$

Time limit is 0.4 sec

Read more »

 
 
 
 
  • Vote: I like it
  • +2
  • Vote: I do not like it