結果
問題 |
No.4 おもりと天秤
|
ユーザー |
|
提出日時 | 2020-05-21 20:17:46 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 362 bytes |
コンパイル時間 | 221 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-02 00:41:20 |
合計ジャッジ時間 | 1,735 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 23 |
ソースコード
n = int(input()) w = list(map(int, input().split())) dp = [False for i in range(10001)] dp[0] = True for i in range(n): for j in range(n-1,-1,-1): if dp[i][j] and j + w[i] <= 10000: dp[i][j + w[i]] = True for i in range(10001): if dp[-1][i] and i*2 == sum(w): print("possible") exit() print("impossible")