Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Is my logic correct for the problem related to Kadanes's algorithm?

Правка en1, от white_square, 2023-03-14 20:17:38

The original problem is : 1373D - Maximum Sum on Even Positions

My Approach

Now the approach was correct if we have to reverse only one subarray.

But what if, we can reverse a number of subarray, suppose K. How would that be solved? I came up with the following approach, is it correct?

Approach

Is my approach correct? Please do share your approach too. Thank you. white_square

Теги kadane, white_square

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en5 Английский white_square 2023-03-14 20:28:46 0 (published)
en4 Английский white_square 2023-03-14 20:28:21 241
en3 Английский white_square 2023-03-14 20:18:40 4
en2 Английский white_square 2023-03-14 20:18:10 12 Tiny change: 'ank you.\nwhite_square' -> 'ank you.\n'
en1 Английский white_square 2023-03-14 20:17:38 1240 Initial revision (saved to drafts)