結果
問題 | No.2812 Plus Minus Blackboard |
ユーザー | ニックネーム |
提出日時 | 2024-07-19 21:51:46 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 281 bytes |
コンパイル時間 | 72 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 31,268 KB |
最終ジャッジ日時 | 2024-07-19 21:51:52 |
合計ジャッジ時間 | 3,099 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 27 ms
10,624 KB |
testcase_01 | AC | 25 ms
10,624 KB |
testcase_02 | AC | 26 ms
10,624 KB |
testcase_03 | WA | - |
testcase_04 | AC | 111 ms
22,408 KB |
testcase_05 | AC | 151 ms
29,916 KB |
testcase_06 | AC | 51 ms
13,828 KB |
testcase_07 | AC | 45 ms
13,288 KB |
testcase_08 | AC | 41 ms
12,712 KB |
testcase_09 | AC | 144 ms
27,848 KB |
testcase_10 | AC | 42 ms
12,416 KB |
testcase_11 | AC | 99 ms
21,096 KB |
testcase_12 | AC | 79 ms
18,844 KB |
testcase_13 | AC | 158 ms
30,704 KB |
testcase_14 | AC | 57 ms
15,832 KB |
testcase_15 | AC | 38 ms
12,288 KB |
testcase_16 | AC | 158 ms
28,608 KB |
testcase_17 | WA | - |
testcase_18 | AC | 50 ms
13,792 KB |
testcase_19 | AC | 119 ms
24,676 KB |
testcase_20 | AC | 36 ms
12,160 KB |
testcase_21 | AC | 151 ms
30,652 KB |
testcase_22 | WA | - |
ソースコード
n = int(input()); p = []; q = [] for v in map(int,input().split()): if v>0: p.append(v) elif v<0: q.append(-v) if n==1: exit(print("Yes")) 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")