結果
| 問題 |
No.2812 Plus Minus Blackboard
|
| コンテスト | |
| ユーザー |
PNJ
|
| 提出日時 | 2024-07-19 22:41:24 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 117 ms / 2,000 ms |
| コード長 | 421 bytes |
| コンパイル時間 | 218 ms |
| コンパイル使用メモリ | 82,508 KB |
| 実行使用メモリ | 116,132 KB |
| 最終ジャッジ日時 | 2025-06-20 02:15:07 |
| 合計ジャッジ時間 | 3,985 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 |
ソースコード
N = int(input())
A = list(map(int,input().split()))
if N == 1:
print('Yes')
exit()
B = []
for a in A:
if a == 0:
continue
B.append(a)
if len(B) <= 1:
print('Yes')
exit()
B.sort()
ans = 'No'
if B[0] > 0:
print(ans)
exit()
if B[-1] < 0:
print(ans)
exit()
S = sum(B)
if S - B[0] >= 0 and S <= 0:
ans = 'Yes'
if S - B[-1] <= 0 and S >= 0:
ans = 'Yes'
print(ans)
PNJ