結果

問題 No.5 数字のブロック
ユーザー scillicettscillicett
提出日時 2019-08-25 03:28:18
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 19 ms / 5,000 ms
コード長 216 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 9,244 KB
最終ジャッジ日時 2023-08-05 02:12:22
合計ジャッジ時間 2,158 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,828 KB
testcase_01 AC 15 ms
7,900 KB
testcase_02 AC 14 ms
7,808 KB
testcase_03 AC 17 ms
8,892 KB
testcase_04 AC 15 ms
8,604 KB
testcase_05 AC 17 ms
8,940 KB
testcase_06 AC 16 ms
8,628 KB
testcase_07 AC 15 ms
8,548 KB
testcase_08 AC 16 ms
8,732 KB
testcase_09 AC 15 ms
8,196 KB
testcase_10 AC 17 ms
9,128 KB
testcase_11 AC 16 ms
8,556 KB
testcase_12 AC 17 ms
8,900 KB
testcase_13 AC 18 ms
8,936 KB
testcase_14 AC 14 ms
7,792 KB
testcase_15 AC 15 ms
7,892 KB
testcase_16 AC 18 ms
8,964 KB
testcase_17 AC 19 ms
9,220 KB
testcase_18 AC 17 ms
9,052 KB
testcase_19 AC 18 ms
9,244 KB
testcase_20 AC 14 ms
7,924 KB
testcase_21 AC 14 ms
7,796 KB
testcase_22 AC 14 ms
7,824 KB
testcase_23 AC 15 ms
7,796 KB
testcase_24 AC 14 ms
7,840 KB
testcase_25 AC 15 ms
7,904 KB
testcase_26 AC 15 ms
7,904 KB
testcase_27 AC 14 ms
7,776 KB
testcase_28 AC 15 ms
7,844 KB
testcase_29 AC 16 ms
8,492 KB
testcase_30 AC 15 ms
8,344 KB
testcase_31 AC 14 ms
7,776 KB
testcase_32 AC 14 ms
7,760 KB
testcase_33 AC 14 ms
7,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

l = int(input())
n = int(input())
w = list(map(int,input().split()))
w.sort()

c=0

for i in w:
    if l > 0:
        l -= i
        c +=1
    else:
        break
        
if l >= 0:
    print(c)
else:
    print(c-1)
0