結果

問題 No.5 数字のブロック
ユーザー Kiri8128Kiri8128
提出日時 2020-09-06 00:23:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 5,000 ms
コード長 188 bytes
コンパイル時間 1,607 ms
コンパイル使用メモリ 86,724 KB
実行使用メモリ 75,800 KB
最終ジャッジ日時 2023-08-19 13:17:41
合計ジャッジ時間 4,599 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
70,868 KB
testcase_01 AC 59 ms
71,176 KB
testcase_02 AC 62 ms
71,120 KB
testcase_03 AC 65 ms
75,720 KB
testcase_04 AC 66 ms
75,720 KB
testcase_05 AC 67 ms
75,548 KB
testcase_06 AC 65 ms
75,636 KB
testcase_07 AC 71 ms
75,520 KB
testcase_08 AC 65 ms
75,716 KB
testcase_09 AC 66 ms
75,568 KB
testcase_10 AC 68 ms
75,572 KB
testcase_11 AC 66 ms
75,492 KB
testcase_12 AC 64 ms
75,488 KB
testcase_13 AC 65 ms
75,800 KB
testcase_14 AC 63 ms
71,232 KB
testcase_15 AC 59 ms
71,008 KB
testcase_16 AC 63 ms
75,304 KB
testcase_17 AC 64 ms
75,548 KB
testcase_18 AC 65 ms
75,628 KB
testcase_19 AC 64 ms
75,632 KB
testcase_20 AC 63 ms
71,252 KB
testcase_21 AC 64 ms
71,356 KB
testcase_22 AC 64 ms
71,212 KB
testcase_23 AC 62 ms
71,252 KB
testcase_24 AC 62 ms
71,256 KB
testcase_25 AC 61 ms
71,176 KB
testcase_26 AC 64 ms
71,048 KB
testcase_27 AC 64 ms
71,212 KB
testcase_28 AC 62 ms
71,208 KB
testcase_29 AC 65 ms
75,300 KB
testcase_30 AC 69 ms
75,580 KB
testcase_31 AC 61 ms
71,208 KB
testcase_32 AC 64 ms
70,972 KB
testcase_33 AC 62 ms
70,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L = int(input())
N = int(input())
W = sorted([int(a) for a in input().split()])

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