結果

問題 No.2812 Plus Minus Blackboard
ユーザー ニックネームニックネーム
提出日時 2024-07-19 21:51:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 366 bytes
コンパイル時間 580 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 31,040 KB
最終ジャッジ日時 2024-07-19 21:51:10
合計ジャッジ時間 3,354 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,752 KB
testcase_01 AC 25 ms
10,752 KB
testcase_02 AC 24 ms
10,752 KB
testcase_03 WA -
testcase_04 AC 99 ms
22,676 KB
testcase_05 AC 148 ms
29,680 KB
testcase_06 AC 53 ms
14,252 KB
testcase_07 AC 46 ms
13,296 KB
testcase_08 AC 37 ms
12,724 KB
testcase_09 AC 133 ms
27,476 KB
testcase_10 AC 37 ms
12,544 KB
testcase_11 AC 94 ms
21,616 KB
testcase_12 AC 76 ms
18,728 KB
testcase_13 AC 161 ms
30,696 KB
testcase_14 AC 59 ms
15,704 KB
testcase_15 AC 36 ms
12,288 KB
testcase_16 AC 143 ms
28,512 KB
testcase_17 WA -
testcase_18 AC 44 ms
13,924 KB
testcase_19 AC 112 ms
25,324 KB
testcase_20 AC 43 ms
12,288 KB
testcase_21 AC 154 ms
30,932 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input()); p = []; q = []; z = False
for v in map(int,input().split()):
    if v>0: p.append(v)
    elif v<0: q.append(-v)
    else: z = True
if n==1: exit(print("Yes"))
if z and not p: p.append(0)
if z and not q: q.append(0)
if not p or not q: exit(print("No"))
p.sort(); q.sort(); r = sum(p); s = sum(q)
if r>s: p,q = q,p
print("Yes" if s-q[-1]<r else "No")
0