結果

問題 No.4 おもりと天秤
ユーザー tookunn_1213tookunn_1213
提出日時 2015-08-18 00:10:57
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 280 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 6,660 KB
実行使用メモリ 6,376 KB
最終ジャッジ日時 2023-09-25 12:42:01
合計ジャッジ時間 3,280 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
6,376 KB
testcase_01 AC 20 ms
6,372 KB
testcase_02 AC 30 ms
6,240 KB
testcase_03 AC 28 ms
6,236 KB
testcase_04 AC 35 ms
6,372 KB
testcase_05 AC 174 ms
6,352 KB
testcase_06 AC 14 ms
6,312 KB
testcase_07 AC 173 ms
6,260 KB
testcase_08 AC 172 ms
6,328 KB
testcase_09 AC 86 ms
6,348 KB
testcase_10 AC 172 ms
6,304 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 15 ms
6,192 KB
testcase_14 WA -
testcase_15 AC 15 ms
6,236 KB
testcase_16 AC 25 ms
6,324 KB
testcase_17 AC 22 ms
6,192 KB
testcase_18 AC 130 ms
6,308 KB
testcase_19 AC 172 ms
6,352 KB
testcase_20 AC 173 ms
6,236 KB
testcase_21 AC 173 ms
6,224 KB
testcase_22 AC 173 ms
6,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(raw_input())
W = map(int,raw_input().split())
wSum = sum(W)
dp = [0 for i in range(10100 + 1)]
dp[0] = 1
for i in range(N):
	for j in range(10000 + 1):
		if dp[j] == 1:
			dp[j + W[i]] = 1
if wSum % 2 == 0 and dp[wSum / 2] == 1:
	print 'possible'
else:
	print 'impossible'
0