結果

問題 No.5 数字のブロック
ユーザー TomoyarnTomoyarn
提出日時 2022-02-18 17:13:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 226 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 86,836 KB
実行使用メモリ 75,692 KB
最終ジャッジ日時 2023-09-11 18:12:45
合計ジャッジ時間 4,518 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,196 KB
testcase_01 AC 74 ms
71,280 KB
testcase_02 AC 75 ms
71,284 KB
testcase_03 AC 78 ms
75,416 KB
testcase_04 AC 77 ms
75,624 KB
testcase_05 AC 78 ms
75,572 KB
testcase_06 AC 78 ms
75,496 KB
testcase_07 AC 77 ms
75,560 KB
testcase_08 AC 78 ms
75,440 KB
testcase_09 AC 77 ms
75,376 KB
testcase_10 AC 78 ms
75,252 KB
testcase_11 AC 76 ms
75,412 KB
testcase_12 AC 78 ms
75,436 KB
testcase_13 AC 79 ms
75,480 KB
testcase_14 AC 75 ms
71,248 KB
testcase_15 AC 73 ms
70,892 KB
testcase_16 AC 80 ms
75,568 KB
testcase_17 AC 78 ms
75,520 KB
testcase_18 AC 80 ms
75,384 KB
testcase_19 AC 80 ms
75,368 KB
testcase_20 AC 74 ms
71,352 KB
testcase_21 AC 76 ms
71,268 KB
testcase_22 AC 75 ms
71,032 KB
testcase_23 AC 74 ms
71,148 KB
testcase_24 AC 74 ms
71,240 KB
testcase_25 AC 73 ms
71,356 KB
testcase_26 AC 72 ms
71,332 KB
testcase_27 AC 73 ms
71,344 KB
testcase_28 AC 74 ms
71,148 KB
testcase_29 AC 78 ms
75,492 KB
testcase_30 AC 78 ms
75,692 KB
testcase_31 AC 73 ms
71,292 KB
testcase_32 AC 72 ms
71,392 KB
testcase_33 AC 72 ms
71,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yukicoder No.5 数字のブロック
L, N, *W = map(int, open(0).read().split())
W = sorted(W)
total = 0
cnt = 0
for i in range(N):
    total += W[i]
    if total > L:
        break
    else:
        cnt += 1

print(cnt)
    
0