結果

問題 No.5 数字のブロック
ユーザー HimatsubushinHimatsubushin
提出日時 2019-12-17 15:18:58
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 95 ms / 5,000 ms
コード長 188 bytes
コンパイル時間 661 ms
コンパイル使用メモリ 86,568 KB
実行使用メモリ 75,720 KB
最終ジャッジ日時 2023-09-15 19:38:13
合計ジャッジ時間 4,709 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,196 KB
testcase_01 AC 75 ms
71,108 KB
testcase_02 AC 72 ms
70,704 KB
testcase_03 AC 82 ms
75,596 KB
testcase_04 AC 75 ms
75,492 KB
testcase_05 AC 77 ms
75,520 KB
testcase_06 AC 77 ms
75,620 KB
testcase_07 AC 78 ms
75,564 KB
testcase_08 AC 80 ms
75,544 KB
testcase_09 AC 80 ms
75,388 KB
testcase_10 AC 81 ms
75,528 KB
testcase_11 AC 80 ms
75,524 KB
testcase_12 AC 95 ms
75,720 KB
testcase_13 AC 85 ms
75,620 KB
testcase_14 AC 75 ms
71,236 KB
testcase_15 AC 73 ms
71,188 KB
testcase_16 AC 78 ms
75,704 KB
testcase_17 AC 78 ms
75,688 KB
testcase_18 AC 76 ms
75,452 KB
testcase_19 AC 78 ms
75,460 KB
testcase_20 AC 72 ms
70,964 KB
testcase_21 AC 71 ms
70,968 KB
testcase_22 AC 71 ms
71,224 KB
testcase_23 AC 70 ms
71,212 KB
testcase_24 AC 72 ms
71,204 KB
testcase_25 AC 71 ms
71,104 KB
testcase_26 AC 78 ms
71,220 KB
testcase_27 AC 78 ms
70,948 KB
testcase_28 AC 71 ms
70,868 KB
testcase_29 AC 75 ms
75,572 KB
testcase_30 AC 75 ms
75,532 KB
testcase_31 AC 71 ms
71,180 KB
testcase_32 AC 71 ms
71,072 KB
testcase_33 AC 71 ms
71,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

max = 0
ww = 0

for a in w:
    ww += a
    if ww <= l:
        max += 1
    else:
        break

print(max)
0