結果

問題 No.5 数字のブロック
コンテスト
ユーザー nbisco
提出日時 2016-03-13 14:36:36
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 82 ms / 5,000 ms
コード長 319 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 77,360 KB
最終ジャッジ日時 2025-12-03 19:48:02
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#fileencoding: utf-8
from __future__ import print_function

def main():
    L = int(raw_input())
    N = int(raw_input())
    W = sorted([int(i) for i in raw_input().split()])
    count = 0
    for i in W:
        L -= i
        if L >= 0:
            count += 1
    print(count)

if __name__ == "__main__":
    main()
0