結果

問題 No.4 おもりと天秤
ユーザー maatanbeta
提出日時 2017-05-12 15:41:26
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 381 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-15 10:42:27
合計ジャッジ時間 2,640 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
w = list(map(int, input().split()))
W = 0
for i in w:
    W += i / 2
if W == int(W):
    W = int(W)
    p = [False] * (W + 1)
    p[0] = True
    for i in w:
        for k in range(len(p)):
            if p[k] and k + i <= W:
                p[k+i] = True
    if p[W]:
        print("possible")
    else:
        print("impossible")
else:
    print("impossible")
0