結果
| 問題 |
No.617 Nafmo、買い出しに行く
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-11 20:02:08 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 251 bytes |
| コンパイル時間 | 1,029 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 67,536 KB |
| 最終ジャッジ日時 | 2024-06-11 20:02:22 |
| 合計ジャッジ時間 | 10,146 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 RE * 4 |
ソースコード
from itertools import combinations
n, k = map(int, input().split())
W = [int(input()) for _ in range(n)]
ans = []
for i in range(1, n+1):
for j in list(combinations(W, i)):
if sum(j) <= k:
ans.append(sum(j))
print(max(ans))