結果

問題 No.5 数字のブロック
ユーザー warashiwarashi
提出日時 2015-02-12 22:36:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 24 ms / 5,000 ms
コード長 229 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 10,648 KB
実行使用メモリ 9,824 KB
最終ジャッジ日時 2023-08-11 08:07:22
合計ジャッジ時間 2,084 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,556 KB
testcase_01 AC 21 ms
8,668 KB
testcase_02 AC 21 ms
8,568 KB
testcase_03 AC 23 ms
9,348 KB
testcase_04 AC 20 ms
9,144 KB
testcase_05 AC 22 ms
9,552 KB
testcase_06 AC 21 ms
9,244 KB
testcase_07 AC 22 ms
9,060 KB
testcase_08 AC 22 ms
9,328 KB
testcase_09 AC 20 ms
8,832 KB
testcase_10 AC 23 ms
9,540 KB
testcase_11 AC 22 ms
9,020 KB
testcase_12 AC 22 ms
9,260 KB
testcase_13 AC 23 ms
9,456 KB
testcase_14 AC 19 ms
8,652 KB
testcase_15 AC 19 ms
8,628 KB
testcase_16 AC 22 ms
9,532 KB
testcase_17 AC 22 ms
9,584 KB
testcase_18 AC 23 ms
9,496 KB
testcase_19 AC 24 ms
9,824 KB
testcase_20 AC 19 ms
8,700 KB
testcase_21 AC 19 ms
8,584 KB
testcase_22 AC 19 ms
8,704 KB
testcase_23 AC 18 ms
8,580 KB
testcase_24 AC 19 ms
8,672 KB
testcase_25 AC 19 ms
8,628 KB
testcase_26 AC 19 ms
8,616 KB
testcase_27 AC 19 ms
8,580 KB
testcase_28 AC 19 ms
8,720 KB
testcase_29 AC 21 ms
9,172 KB
testcase_30 AC 20 ms
8,876 KB
testcase_31 AC 19 ms
8,560 KB
testcase_32 AC 19 ms
8,752 KB
testcase_33 AC 18 ms
8,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
from functools import lru_cache

L = int(input())
N = int(input())
W = sorted(map(int, input().split()))
count = 0
sum = 0
for w in W:
    sum += w
    if sum > L:
        break
    count += 1
print(count)
0