結果
| 問題 | No.4 おもりと天秤 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-04-05 14:32:38 | 
| 言語 | Python2 (2.7.18) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 113 ms / 5,000 ms | 
| コード長 | 313 bytes | 
| コンパイル時間 | 447 ms | 
| コンパイル使用メモリ | 6,912 KB | 
| 実行使用メモリ | 6,528 KB | 
| 最終ジャッジ日時 | 2024-06-26 10:13:51 | 
| 合計ジャッジ時間 | 1,959 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 23 | 
ソースコード
# coding: utf-8
iin = int(raw_input())
iiw = map(int, raw_input().split())
Max = 100*100
dp = [False]*(Max+1)
dp[0] = True
sum = 0
for x in iiw:
    sum += x
    for i in xrange(Max, -1, -1):
	    if dp[i] : dp[i+x] = True
if ((sum%2==0) and dp[sum/2]) : 
    print "possible"
else : 
    print "impossible"
            
            
            
        