結果
問題 |
No.4 おもりと天秤
|
ユーザー |
|
提出日時 | 2020-05-21 20:20:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 200 ms / 5,000 ms |
コード長 | 354 bytes |
コンパイル時間 | 430 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-10-02 00:42:50 |
合計ジャッジ時間 | 3,309 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 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(10000,-1,-1): if dp[j] and j + w[i] <= 10000: dp[j + w[i]] = True for i in range(10001): if dp[i] and i*2 == sum(w): print("possible") exit() print("impossible")