Need help with this problem

Правка en1, от NoobCoder1998, 2025-01-12 11:51:07

You are given 2 arrays. Choose a subarray from the first array (arr1) and replace it with the corresponding subarray from the second array (arr2). After replacing the subarray, calculate the maximum consecutive subarray sum of the modified first array. Find the maximum subarray sum you can get by doing this operation.

N is 10^5 and ai [-1e9, 1e9]

Im not able to think of better than n^2. Pls help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский NoobCoder1998 2025-01-12 11:52:07 1 Tiny change: ' only once\n\n\nN is' -> ' only once.\n\n\nN is'
en2 Английский NoobCoder1998 2025-01-12 11:51:49 39
en1 Английский NoobCoder1998 2025-01-12 11:51:07 438 Initial revision (published)