結果

問題 No.4 おもりと天秤
ユーザー Makorominiris
提出日時 2016-05-26 23:11:46
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 245 ms / 5,000 ms
コード長 210 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-06-26 09:34:04
合計ジャッジ時間 3,728 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
l=[0]*(N*100+101)
l[0]=1
s=0
for v in list(map(int,input().split())):
    s+=v
    for i in range(N*100, -1, -1):
        l[i+v]+=l[i]
print("impossible" if s%2==1 or not l[s//2] else "possible")
0