結果
| 問題 | No.4 おもりと天秤 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-09 21:30:21 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 62 ms / 5,000 ms |
| + 703µs | |
| コード長 | 245 bytes |
| 記録 | |
| コンパイル時間 | 74 ms |
| コンパイル使用メモリ | 81,152 KB |
| 実行使用メモリ | 82,432 KB |
| 最終ジャッジ日時 | 2026-07-17 09:14:55 |
| 合計ジャッジ時間 | 3,150 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
N = int(raw_input())
W = map(int,raw_input().split())
sw = sum(W)
dp = [0]*(sw+1)
for w in W:
for i in range(sw+1-w)[::-1]:
if dp[i]:
dp[i+w] = 1
dp[w] = 1
print "possible" if sw%2 == 0 and dp[sw/2] else "impossible"