Codeforces and Polygon may be unavailable from December 6, 19:00 (UTC) to December 6, 21:00 (UTC) due to technical maintenance. ×
Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

Pls help in this problem

Revision en3, by 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.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English robertlewantest 2024-04-13 20:25:48 1 Tiny change: '\nAi<=10^9' -> '\nAi<=10^9.'
en2 English 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 English robertlewantest 2024-04-13 16:44:17 317 Initial revision (published)