結果

問題 No.1586 Equal Array
コンテスト
ユーザー 👑 ArcAki
提出日時 2025-11-14 16:32:37
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 104 ms / 1,000 ms
コード長 206 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 21,360 KB
最終ジャッジ日時 2025-11-14 16:32:40
合計ジャッジ時間 3,222 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())
f = 1
ok = True
pre = -1
ac = 0
for c in list(map(int, input().split())):
	f ^= c&1
	ok &= pre < 0 or pre==c
	if pre < 0:
		pre = c
	ac += c
print("Yes" if (f and not ac%n) or ok else "No")
0