結果
問題 |
No.3220 Forest Creation
|
ユーザー |
|
提出日時 | 2025-08-01 23:01:05 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 489 bytes |
コンパイル時間 | 187 ms |
コンパイル使用メモリ | 82,376 KB |
実行使用メモリ | 82,780 KB |
最終ジャッジ日時 | 2025-08-02 00:02:19 |
合計ジャッジ時間 | 3,430 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 45 WA * 1 |
ソースコード
import sys input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) hand = 0 for i in range(N, 1, -1): if A[i]==0: continue if hand==0: hand += i A[i]-=1 if A[i]==0: continue hand += (i-2)*A[i] if A[1]>hand: amari = A[1]-hand if amari%2==0: print("Yes") else: if amari>N: print("Yes") else: print("No") elif A[1]==hand: print("Yes") else: print("No")