結果
| 問題 | No.4 おもりと天秤 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-01-15 14:19:26 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 30 ms / 5,000 ms |
| + 960µs | |
| コード長 | 337 bytes |
| 記録 | |
| コンパイル時間 | 214 ms |
| コンパイル使用メモリ | 82,140 KB |
| 実行使用メモリ | 74,752 KB |
| 最終ジャッジ日時 | 2026-10-08 22:15:56 |
| 合計ジャッジ時間 | 2,533 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
n=int(input())
W=list(map(int,input().split()))
sum_W=sum(W)
if sum_W%2==1:
print("impossible")
exit()
target=sum_W//2
box=set([0])
for w in W:
n_box=set()
for b in box:
if b+w<=target:
n_box.add(b+w)
box|=n_box
if target in box:
print("possible")
exit()
print("impossible")