結果

問題 No.5 数字のブロック
ユーザー brthyyjpbrthyyjp
提出日時 2020-08-29 12:54:34
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 76 ms / 5,000 ms
コード長 187 bytes
コンパイル時間 423 ms
コンパイル使用メモリ 86,712 KB
実行使用メモリ 75,744 KB
最終ジャッジ日時 2023-08-09 00:22:25
合計ジャッジ時間 5,283 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,272 KB
testcase_01 AC 73 ms
71,228 KB
testcase_02 AC 76 ms
71,100 KB
testcase_03 AC 76 ms
75,732 KB
testcase_04 AC 74 ms
75,744 KB
testcase_05 AC 75 ms
75,384 KB
testcase_06 AC 73 ms
75,444 KB
testcase_07 AC 74 ms
75,476 KB
testcase_08 AC 74 ms
75,740 KB
testcase_09 AC 74 ms
75,588 KB
testcase_10 AC 76 ms
75,336 KB
testcase_11 AC 75 ms
75,384 KB
testcase_12 AC 75 ms
75,356 KB
testcase_13 AC 75 ms
75,680 KB
testcase_14 AC 72 ms
70,992 KB
testcase_15 AC 70 ms
71,276 KB
testcase_16 AC 75 ms
75,436 KB
testcase_17 AC 74 ms
75,560 KB
testcase_18 AC 74 ms
75,744 KB
testcase_19 AC 73 ms
75,336 KB
testcase_20 AC 73 ms
71,100 KB
testcase_21 AC 72 ms
70,988 KB
testcase_22 AC 73 ms
71,316 KB
testcase_23 AC 73 ms
71,284 KB
testcase_24 AC 73 ms
71,324 KB
testcase_25 AC 73 ms
71,144 KB
testcase_26 AC 70 ms
71,248 KB
testcase_27 AC 71 ms
70,852 KB
testcase_28 AC 71 ms
70,840 KB
testcase_29 AC 74 ms
75,656 KB
testcase_30 AC 74 ms
75,736 KB
testcase_31 AC 72 ms
71,152 KB
testcase_32 AC 70 ms
71,024 KB
testcase_33 AC 72 ms
71,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

l = int(input())
n = int(input())
W = list(map(int, input().split()))
W.sort()
s = 0
for i, w in enumerate(W):
    s += w
    if s > l:
        print(i)
        exit()
else:
    print(n)
0