結果
問題 |
No.4 おもりと天秤
|
ユーザー |
|
提出日時 | 2017-03-12 14:09:36 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 541 bytes |
コンパイル時間 | 121 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-30 00:26:11 |
合計ジャッジ時間 | 9,228 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 WA * 8 |
ソースコード
n = int(input()) a = [int(i) for i in input().split()] #print(n,a) log = [] if sum(a) % 2 == 1: print("impossible") else: half = sum(a) / 2 for i in range(n): l = len(log) if a[i] not in log: log.append(a[i]) for j in range(l): b = a[i] + log[j] if b not in log: log.append(b) #print(i,log,half) if half in log: print("possible") break else: if i == (n-1): print("impossibleB")