結果

問題 No.2836 Comment Out
ユーザー Shirotsume
提出日時 2024-08-09 21:46:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 630 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 82,380 KB
実行使用メモリ 130,516 KB
最終ジャッジ日時 2024-08-09 21:46:48
合計ジャッジ時間 7,903 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 42 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
import logging
from logging import debug, error, info, warning
logging.basicConfig(level=logging.DEBUG)
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 61 - 1
mod = 998244353

n = ii()
a = [0] + li() + [0]
A = []
if 1 not in a:
    print('No')
    exit()
for i in range(n + 1):
    A.append(a[i + 1] - a[i])
cnt = 0
ans = 'Yes'
for i in range(len(A)):
    cnt += A[i]
    if cnt < 0:
        ans = 'No'
        break
if cnt != 0:
    ans = 'No'
print(ans)
0