結果

問題 No.4 おもりと天秤
ユーザー TawaraTawara
提出日時 2015-12-26 08:40:42
言語 Python2
(2.7.18)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 153 bytes
コンパイル時間 516 ms
コンパイル使用メモリ 6,572 KB
実行使用メモリ 6,136 KB
最終ジャッジ日時 2023-09-08 16:30:52
合計ジャッジ時間 2,103 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,108 KB
testcase_01 AC 11 ms
6,032 KB
testcase_02 AC 13 ms
5,900 KB
testcase_03 AC 11 ms
5,952 KB
testcase_04 AC 13 ms
6,096 KB
testcase_05 AC 78 ms
5,968 KB
testcase_06 AC 11 ms
6,060 KB
testcase_07 AC 83 ms
6,132 KB
testcase_08 AC 13 ms
6,028 KB
testcase_09 AC 136 ms
6,024 KB
testcase_10 AC 87 ms
6,124 KB
testcase_11 AC 12 ms
6,028 KB
testcase_12 AC 12 ms
6,136 KB
testcase_13 AC 11 ms
6,092 KB
testcase_14 AC 11 ms
6,116 KB
testcase_15 AC 11 ms
5,984 KB
testcase_16 AC 11 ms
5,988 KB
testcase_17 AC 12 ms
5,968 KB
testcase_18 AC 74 ms
6,084 KB
testcase_19 AC 71 ms
6,128 KB
testcase_20 AC 72 ms
6,116 KB
testcase_21 AC 67 ms
5,924 KB
testcase_22 AC 69 ms
5,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

input();W=map(int,raw_input().split());S=sum(W)
H=S/2;D=[0]*(H+101);D[0]=1
for w in W:
	i=H
	while i:i-=1;D[i+w]|=D[i]
print"impossible"[2*D[H]*(S%2^1):]
0