結果
| 問題 |
No.4 おもりと天秤
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-09-13 14:34:42 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 369 bytes |
| コンパイル時間 | 235 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-11-17 04:47:47 |
| 合計ジャッジ時間 | 3,563 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 WA * 2 |
ソースコード
n = int(input())
w = list(map(int, input().split()))
weightSum = sum(w)
if weightSum % 2 == 1: print("impossible")
weightPossible = [0]*10001
weightPossible[0] = 1
for i in range(n):
for j in reversed(range(10001)):
if weightPossible[j - w[i]] == 1:
weightPossible[j] = 1
if weightPossible[weightSum // 2] == 1:
print("possible")
else:
print("impossible")