結果

問題 No.617 Nafmo、買い出しに行く
ユーザー Kory__3Kory__3
提出日時 2017-12-17 15:27:22
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 454 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-12-15 22:24:58
合計ジャッジ時間 1,907 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
def get_ln_inputs():
    return input().split()


def map_list(fn, xs):
    return list(map(fn, xs))


def get_ln_int_inputs():
    return map_list(int, get_ln_inputs())


def main():
    N, K = get_ln_int_inputs()
    A = list()
    for _ in range(N):
        A.append(get_ln_int_inputs()[0])
    As = sorted(A)[::-1]
    W = 0

    for a in As:
        if W + a > K:
            continue
        W += a

    print(W)
    return


main()
0