結果
問題 | No.2812 Plus Minus Blackboard |
ユーザー | ニックネーム |
提出日時 | 2024-07-19 21:49:08 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 275 bytes |
コンパイル時間 | 128 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 31,524 KB |
最終ジャッジ日時 | 2024-07-19 21:49:11 |
合計ジャッジ時間 | 2,986 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 26 ms
10,624 KB |
testcase_01 | AC | 31 ms
10,752 KB |
testcase_02 | AC | 29 ms
10,624 KB |
testcase_03 | WA | - |
testcase_04 | AC | 106 ms
22,744 KB |
testcase_05 | AC | 151 ms
28,988 KB |
testcase_06 | AC | 48 ms
14,096 KB |
testcase_07 | AC | 45 ms
13,148 KB |
testcase_08 | AC | 40 ms
12,572 KB |
testcase_09 | AC | 131 ms
26,908 KB |
testcase_10 | AC | 37 ms
12,288 KB |
testcase_11 | AC | 104 ms
21,568 KB |
testcase_12 | AC | 81 ms
18,576 KB |
testcase_13 | AC | 153 ms
30,580 KB |
testcase_14 | AC | 57 ms
15,688 KB |
testcase_15 | AC | 36 ms
12,288 KB |
testcase_16 | AC | 134 ms
28,080 KB |
testcase_17 | WA | - |
testcase_18 | AC | 45 ms
14,032 KB |
testcase_19 | AC | 116 ms
24,788 KB |
testcase_20 | AC | 36 ms
12,288 KB |
testcase_21 | AC | 148 ms
30,252 KB |
testcase_22 | WA | - |
ソースコード
n = int(input()) p = []; q = [] for v in map(int,input().split()): if v>0: p.append(v) else: 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")