結果

問題 No.4 おもりと天秤
ユーザー Tawara
提出日時 2015-09-12 16:45:35
言語 Python2
(2.7.18)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 168 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2024-06-26 09:17:41
合計ジャッジ時間 1,427 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

input()
W = map(int,raw_input().split())
S = sum(W)
dp = {0} 
for w in W:
	for i in list(dp):
		dp.add(i+w)
print "possible" if S%2 == 0 and S/2 in dp else "impossible"
0