結果

問題 No.5 数字のブロック
ユーザー otsunekootsuneko
提出日時 2021-04-25 02:04:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 82 ms / 5,000 ms
コード長 212 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 75,832 KB
最終ジャッジ日時 2023-09-17 13:58:32
合計ジャッジ時間 4,294 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,184 KB
testcase_01 AC 79 ms
71,292 KB
testcase_02 AC 76 ms
71,240 KB
testcase_03 AC 80 ms
75,644 KB
testcase_04 AC 79 ms
75,624 KB
testcase_05 AC 81 ms
75,720 KB
testcase_06 AC 79 ms
75,588 KB
testcase_07 AC 80 ms
75,832 KB
testcase_08 AC 80 ms
75,692 KB
testcase_09 AC 78 ms
75,616 KB
testcase_10 AC 82 ms
75,676 KB
testcase_11 AC 79 ms
75,628 KB
testcase_12 AC 81 ms
75,712 KB
testcase_13 AC 80 ms
75,652 KB
testcase_14 AC 77 ms
71,112 KB
testcase_15 AC 77 ms
71,060 KB
testcase_16 AC 81 ms
75,832 KB
testcase_17 AC 80 ms
75,620 KB
testcase_18 AC 80 ms
75,676 KB
testcase_19 AC 79 ms
75,500 KB
testcase_20 AC 75 ms
71,064 KB
testcase_21 AC 75 ms
71,048 KB
testcase_22 AC 75 ms
71,184 KB
testcase_23 AC 75 ms
71,476 KB
testcase_24 AC 75 ms
71,332 KB
testcase_25 AC 76 ms
71,052 KB
testcase_26 AC 74 ms
71,124 KB
testcase_27 AC 75 ms
71,344 KB
testcase_28 AC 74 ms
71,284 KB
testcase_29 AC 78 ms
75,640 KB
testcase_30 AC 77 ms
75,684 KB
testcase_31 AC 73 ms
71,272 KB
testcase_32 AC 74 ms
71,144 KB
testcase_33 AC 75 ms
70,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L = int(input())
N = int(input())
W = list(map(int,input().split()))

W.sort()

total = 0
for i,w in enumerate(W):
    total += w
    if total > L:
        print(i)
        break
else:
    print(i+1)
0