結果

問題 No.617 Nafmo、買い出しに行く
ユーザー fV9TwBhUoa9S3eV
提出日時 2019-10-18 15:20:45
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 229 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-25 14:25:01
合計ジャッジ時間 1,614 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

# No.617 Nafmo、買い出しに行く
n, k = [int(s) for s in input().split()]
a = []

for i in range(n):
    a.append(int(input()))

weight = 0
a.reverse()

for b in a:
    if weight + b <= k:
        weight += b

print(weight)
0