Pls help in this problem

Правка en3, от robertlewantest, 2024-04-13 20:25:48

Given an array of N positive integers. You can make any number of elements in it negative such that every prefix sum of the array remains positive i.e >0. Find the maximum number of elements you can make negative.

Example 5 2 3 5 2 3

Answer= 3. This can be converted to 5 -2 3 5 -2 -3

N is 10^5 Ai<=10^9.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский robertlewantest 2024-04-13 20:25:48 1 Tiny change: '\nAi<=10^9' -> '\nAi<=10^9.'
en2 Английский robertlewantest 2024-04-13 16:55:21 24 Tiny change: ' 3 5 -2 -3' -> ' 3 5 -2 -3\n\nN is 10^5\nAi<=10^9'
en1 Английский robertlewantest 2024-04-13 16:44:17 317 Initial revision (published)