結果
| 問題 | No.4 おもりと天秤 | 
| コンテスト | |
| ユーザー |  popketle | 
| 提出日時 | 2019-12-24 12:20:16 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 375 bytes | 
| コンパイル時間 | 90 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 18,688 KB | 
| 最終ジャッジ日時 | 2024-09-21 19:56:47 | 
| 合計ジャッジ時間 | 3,631 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 RE * 1 | 
ソースコード
n=int(input())
W=list(map(int,input().split()))
if sum(W)%2!=0:
  print('impossible')
  exit()
dp=[[False]*(100*100+1) for _ in range(101)]
dp[0][0],dp[0][W[0]]=True,True
for i in range(n):
  for j in range(100*100+1):
    if dp[i][j]==True:
      dp[i+1][j+W[i]]=True
      dp[i+1][j]=True
if dp[n][int(sum(W)/2)]==True:
    print('possible')
    exit()
print('impossible')
            
            
            
        