結果

問題 No.3220 Forest Creation
ユーザー detteiuu
提出日時 2025-08-02 04:36:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 82,728 KB
実行使用メモリ 84,172 KB
最終ジャッジ日時 2025-08-02 04:36:29
合計ジャッジ時間 4,728 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 46
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

while A and A[-1] == 0:
    A.pop()
    N -= 1

if N <= 0:
    exit(print("Yes"))
if N == 1:
    exit(print("Yes" if A[1]%2 == 0 else "No"))
if sum(A[1:]) == 0:
    exit(print("Yes"))

SUM = 2
for i in range(2, N+1):
    SUM += (i-2)*A[i]

print("Yes" if SUM <= A[1] else "No")
0