結果

問題 No.5 数字のブロック
ユーザー splash9494splash9494
提出日時 2020-05-03 21:22:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 228 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 75,916 KB
最終ジャッジ日時 2023-09-05 04:47:43
合計ジャッジ時間 4,636 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,168 KB
testcase_01 AC 78 ms
71,428 KB
testcase_02 AC 79 ms
71,300 KB
testcase_03 AC 82 ms
75,700 KB
testcase_04 AC 82 ms
75,524 KB
testcase_05 AC 83 ms
75,708 KB
testcase_06 AC 82 ms
75,556 KB
testcase_07 AC 82 ms
75,644 KB
testcase_08 AC 84 ms
75,696 KB
testcase_09 AC 82 ms
75,720 KB
testcase_10 AC 84 ms
75,592 KB
testcase_11 AC 82 ms
75,672 KB
testcase_12 AC 82 ms
75,916 KB
testcase_13 AC 82 ms
75,596 KB
testcase_14 AC 77 ms
71,140 KB
testcase_15 AC 77 ms
71,308 KB
testcase_16 AC 86 ms
75,608 KB
testcase_17 AC 86 ms
75,560 KB
testcase_18 AC 86 ms
75,716 KB
testcase_19 AC 86 ms
75,744 KB
testcase_20 WA -
testcase_21 AC 76 ms
71,212 KB
testcase_22 AC 78 ms
71,344 KB
testcase_23 AC 81 ms
71,232 KB
testcase_24 AC 80 ms
71,340 KB
testcase_25 AC 76 ms
71,348 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 82 ms
75,700 KB
testcase_30 AC 80 ms
75,560 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

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 and cnt < N:
    s += Ws[cnt]
    cnt += 1
print(cnt if s == L else cnt - 1)
0