結果
| 問題 |
No.617 Nafmo、買い出しに行く
|
| コンテスト | |
| ユーザー |
FVRChan
|
| 提出日時 | 2018-06-03 09:20:42 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 894 ms / 2,000 ms |
| コード長 | 263 bytes |
| コンパイル時間 | 84 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-06-30 09:13:30 |
| 合計ジャッジ時間 | 9,485 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 |
ソースコード
from itertools import combinations n,k=list(map(int,input().split())) a=sorted([int(input()) for i in range(n)],reverse=True) ans=0 for i in range(1,n+1): for v in combinations(a,i): sum_value=sum(v) ans=max(sum_value,ans) if sum_value<=k else ans print(ans)
FVRChan