結果
| 問題 |
No.4 おもりと天秤
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-09-02 00:52:59 |
| 言語 | Python2 (2.7.18) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 328 bytes |
| コンパイル時間 | 47 ms |
| コンパイル使用メモリ | 6,784 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 00:40:58 |
| 合計ジャッジ時間 | 1,674 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 3 |
ソースコード
n = int(input()) arr = map(int,raw_input().split()) accumlate = sum(arr) if accumlate %2 == 1: print 'impossible' quit() dp = [0 for i in range(accumlate/2 + 1)] dp[0] = 1 for i in arr: for j in range(accumlate/2+1): if j - i > -1 and dp[j-i] == 1: dp[j] = 1 print 'possible' if dp[accumlate/2] else 'impossible'