結果
| 問題 |
No.4 おもりと天秤
|
| コンテスト | |
| ユーザー |
HiroK_abc
|
| 提出日時 | 2017-06-19 00:43:35 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 48 ms / 5,000 ms |
| コード長 | 290 bytes |
| コンパイル時間 | 93 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,392 KB |
| 最終ジャッジ日時 | 2024-06-26 10:19:40 |
| 合計ジャッジ時間 | 1,702 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
N=int(input())
weights=list(map(int,input().split()))
S=sum(weights)
sum_list=set([0])
if S&1:
sum_list.clear()
else:
for weight in weights:
sum_list |= set([weight + l for l in sum_list])
if S/2 in sum_list:
break
print("possible" if S/2 in sum_list else "impossible")
HiroK_abc