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

Mock Div. 4 Practice Contest — Problem A

Правка en8, от megahertz13, 2024-10-02 18:50:23

Post your code in the comments to get featured.

A. Possible Subscribers

Input file: standard input

Output file: standard output

Time limit: 1 second

Memory limit: 256 megabytes

MegaMath Channel starts at 0 subscribers. Every day i, the channel gains x_i subscribers. Help MegaMath determine whether this is a possible sequence of values of x_i (the total number of subscribers must stay ≥ 0.)

Input

The first line contains the number of days n (1 <= n <= 100).

The next n lines contain a single integer -10 <= x_i <= 10.

Output

Print "Yes" if the total number of subscribers MegaMath Channel has is, at any given day, >= 0.

Otherwise, print "No".

Sample Code by [blank]:

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en9 Английский megahertz13 2024-10-02 20:00:28 26 Tiny change: '[blank]:**' -> '[blank]:**\n[post code in comments!]'
en8 Английский megahertz13 2024-10-02 18:50:23 1 Tiny change: 'by [blank]**' -> 'by [blank]:**'
en7 Английский megahertz13 2024-10-02 18:43:35 97
en6 Английский megahertz13 2024-10-02 18:41:32 9
en5 Английский megahertz13 2024-10-02 18:39:30 3
en4 Английский megahertz13 2024-10-02 18:39:09 28
en3 Английский megahertz13 2024-10-02 18:38:29 6
en2 Английский megahertz13 2024-10-02 18:37:56 6
en1 Английский megahertz13 2024-10-02 18:37:45 643 Initial revision (published)