結果

問題 No.5 数字のブロック
ユーザー pajannatpajannat
提出日時 2021-04-04 21:58:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 276 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 76,000 KB
最終ジャッジ日時 2023-08-28 08:49:15
合計ジャッジ時間 4,594 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,276 KB
testcase_01 AC 72 ms
71,184 KB
testcase_02 AC 73 ms
71,152 KB
testcase_03 AC 77 ms
75,384 KB
testcase_04 AC 83 ms
75,420 KB
testcase_05 AC 77 ms
75,368 KB
testcase_06 AC 77 ms
75,428 KB
testcase_07 AC 77 ms
75,532 KB
testcase_08 AC 77 ms
75,828 KB
testcase_09 AC 77 ms
76,000 KB
testcase_10 AC 78 ms
75,396 KB
testcase_11 AC 77 ms
75,620 KB
testcase_12 AC 78 ms
75,392 KB
testcase_13 AC 80 ms
75,472 KB
testcase_14 AC 75 ms
71,136 KB
testcase_15 AC 74 ms
71,116 KB
testcase_16 AC 79 ms
75,304 KB
testcase_17 AC 80 ms
75,300 KB
testcase_18 AC 78 ms
75,816 KB
testcase_19 AC 79 ms
75,724 KB
testcase_20 AC 74 ms
71,268 KB
testcase_21 AC 73 ms
71,316 KB
testcase_22 AC 74 ms
71,148 KB
testcase_23 AC 74 ms
71,052 KB
testcase_24 AC 74 ms
71,060 KB
testcase_25 AC 75 ms
71,140 KB
testcase_26 AC 73 ms
71,156 KB
testcase_27 AC 74 ms
71,040 KB
testcase_28 AC 74 ms
71,172 KB
testcase_29 AC 78 ms
75,412 KB
testcase_30 AC 79 ms
75,472 KB
testcase_31 AC 75 ms
71,144 KB
testcase_32 AC 72 ms
71,240 KB
testcase_33 AC 74 ms
71,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 箱の幅
L = int(input())

# ブロックの数
N = int(input())

# ブロックの幅Wを昇順に格納
W = [int(i) for i in input().split()]
W = sorted(W)

# カウント
cnt = 0

for i in range(N):
	L -= W[i]
	if L < 0:
		break;
	cnt += 1

print(cnt)
0