結果
| 問題 | No.617 Nafmo、買い出しに行く |
| コンテスト | |
| ユーザー |
FVRChan
|
| 提出日時 | 2018-06-03 09:20:42 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 510 ms / 2,000 ms |
| コード長 | 263 bytes |
| 記録 | |
| コンパイル時間 | 491 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-03-20 05:30:11 |
| 合計ジャッジ時間 | 7,512 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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