結果

問題 No.5 数字のブロック
ユーザー splash9494splash9494
提出日時 2020-05-03 21:16:55
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 217 bytes
コンパイル時間 474 ms
コンパイル使用メモリ 86,896 KB
実行使用メモリ 79,264 KB
最終ジャッジ日時 2023-09-05 04:35:35
合計ジャッジ時間 5,481 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,244 KB
testcase_01 AC 77 ms
71,240 KB
testcase_02 AC 70 ms
71,072 KB
testcase_03 AC 76 ms
75,448 KB
testcase_04 AC 74 ms
75,588 KB
testcase_05 AC 75 ms
75,712 KB
testcase_06 AC 77 ms
75,544 KB
testcase_07 AC 75 ms
75,788 KB
testcase_08 AC 77 ms
75,844 KB
testcase_09 AC 74 ms
75,784 KB
testcase_10 AC 77 ms
75,460 KB
testcase_11 AC 76 ms
75,460 KB
testcase_12 AC 74 ms
75,576 KB
testcase_13 AC 75 ms
75,548 KB
testcase_14 AC 73 ms
71,068 KB
testcase_15 AC 76 ms
71,256 KB
testcase_16 AC 78 ms
75,588 KB
testcase_17 AC 78 ms
75,736 KB
testcase_18 AC 78 ms
75,632 KB
testcase_19 AC 77 ms
75,780 KB
testcase_20 RE -
testcase_21 AC 73 ms
71,288 KB
testcase_22 AC 74 ms
71,336 KB
testcase_23 AC 73 ms
71,020 KB
testcase_24 AC 72 ms
71,244 KB
testcase_25 AC 74 ms
70,884 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 AC 76 ms
75,544 KB
testcase_30 AC 74 ms
75,500 KB
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.buffer.readline

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

s = 0
cnt = 0
while s < L:
    s += Ws[cnt]
    cnt += 1
print(cnt if s == L else cnt - 1)
0