結果

問題 No.4 おもりと天秤
ユーザー konsin_tokage
提出日時 2018-05-04 18:05:56
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 238 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 82,540 KB
実行使用メモリ 848,720 KB
最終ジャッジ日時 2024-06-28 01:13:29
合計ジャッジ時間 4,023 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 MLE * 1 -- * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
w = list(map(int, input().split()))
m = sum(w)/2
dp = [0]
for wi in w:
    for j in range(len(dp)):
        if dp[j]+wi <= m:
            dp.append(dp[j]+wi)
if m in dp:
    print("possible")
else:
    print("impossible")
0