結果
| 問題 | No.4 おもりと天秤 |
| コンテスト | |
| ユーザー |
るさ
|
| 提出日時 | 2018-06-03 17:31:02 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 400 bytes |
| 記録 | |
| コンパイル時間 | 550 ms |
| コンパイル使用メモリ | 20,952 KB |
| 実行使用メモリ | 15,484 KB |
| 最終ジャッジ日時 | 2026-03-20 05:52:24 |
| 合計ジャッジ時間 | 4,161 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 3 |
ソースコード
n=int(input())
w=list(map(int,input().split()))
hw=int(sum(w)/2)
if hw*2!=sum(w):
print("impossible")
else:
table=[0 for i in range(hw+1)]
table[0]=1
for i in w:
for j in range(hw+1):
try:
table[j+i]=max(table[j+i],table[j])
except:
pass
if table[-1]==1:
print("possible")
else:
print("impossible")
るさ