結果

問題 No.5 数字のブロック
ユーザー 310icecrystal310icecrystal
提出日時 2023-07-06 07:38:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 5,000 ms
コード長 179 bytes
コンパイル時間 485 ms
コンパイル使用メモリ 86,880 KB
実行使用メモリ 75,728 KB
最終ジャッジ日時 2023-09-27 08:40:50
合計ジャッジ時間 4,359 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
70,828 KB
testcase_01 AC 73 ms
71,152 KB
testcase_02 AC 72 ms
71,172 KB
testcase_03 AC 84 ms
75,456 KB
testcase_04 AC 75 ms
75,452 KB
testcase_05 AC 76 ms
75,424 KB
testcase_06 AC 77 ms
75,504 KB
testcase_07 AC 77 ms
75,600 KB
testcase_08 AC 77 ms
75,728 KB
testcase_09 AC 80 ms
75,556 KB
testcase_10 AC 75 ms
75,652 KB
testcase_11 AC 79 ms
75,460 KB
testcase_12 AC 75 ms
75,332 KB
testcase_13 AC 76 ms
75,376 KB
testcase_14 AC 74 ms
71,264 KB
testcase_15 AC 70 ms
71,176 KB
testcase_16 AC 73 ms
75,424 KB
testcase_17 AC 73 ms
75,452 KB
testcase_18 AC 73 ms
75,476 KB
testcase_19 AC 72 ms
75,460 KB
testcase_20 AC 68 ms
71,036 KB
testcase_21 AC 68 ms
71,024 KB
testcase_22 AC 68 ms
70,968 KB
testcase_23 AC 67 ms
71,176 KB
testcase_24 AC 70 ms
71,052 KB
testcase_25 AC 70 ms
71,244 KB
testcase_26 AC 69 ms
71,060 KB
testcase_27 AC 69 ms
71,028 KB
testcase_28 AC 70 ms
71,324 KB
testcase_29 AC 73 ms
75,376 KB
testcase_30 AC 72 ms
75,376 KB
testcase_31 AC 68 ms
71,112 KB
testcase_32 AC 69 ms
71,264 KB
testcase_33 AC 69 ms
71,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L = int(input())
N = int(input())
W = list(map(int,input().split()))
W.sort()

now = 0
S = 0
while now < N:
	if S + W[now] <= L:
		S += W[now]
		now += 1
	else:
		break
print(now)
0