結果

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

ソースコード

diff #
raw source code

import sys
l=input()
n=input()
a=map(int,raw_input().split())
a.sort()
sum=0
for i in range(n):
    sum+=a[i]
    if sum>l:
        print i
        sys.exit()
print n
0