結果

問題 No.3220 Forest Creation
コンテスト
ユーザー kidodesu
提出日時 2025-08-01 22:20:19
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 348 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 233 ms
コンパイル使用メモリ 96,236 KB
実行使用メモリ 98,048 KB
最終ジャッジ日時 2026-07-13 17:16:18
合計ジャッジ時間 5,657 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 43 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

m = int(input())
A = list(map(int, input().split()))
cnt = 0
for i in range(m+1):
    cnt += A[i] * i

if cnt % 2:
    print("No")
    exit()

n = sum(A[1:])

if 2 * (n - 1) < cnt:
    print("No")
    exit()

k = (2 * n - cnt) // 2

tmp = k * 2
for i in range(2, m+1):
    tmp += (i-2) * A[i]

if A[1] == tmp:
    print("Yes")
else:
    print("No")
0