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

Блог пользователя megahertz13

Автор megahertz13, история, 4 часа назад, По-английски

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]: [post code in comments!]

  • Проголосовать: нравится
  • -5
  • Проголосовать: не нравится

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by megahertz13 (previous revision, new revision, compare).

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by megahertz13 (previous revision, new revision, compare).

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by megahertz13 (previous revision, new revision, compare).

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by megahertz13 (previous revision, new revision, compare).

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by megahertz13 (previous revision, new revision, compare).

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by megahertz13 (previous revision, new revision, compare).

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by megahertz13 (previous revision, new revision, compare).

»
2 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by megahertz13 (previous revision, new revision, compare).