結果

問題 No.5 数字のブロック
ユーザー VinVin
提出日時 2022-11-14 11:23:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 241 bytes
コンパイル時間 473 ms
コンパイル使用メモリ 10,496 KB
実行使用メモリ 9,188 KB
最終ジャッジ日時 2023-10-13 17:44:34
合計ジャッジ時間 2,140 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,812 KB
testcase_01 AC 13 ms
7,784 KB
testcase_02 AC 14 ms
7,812 KB
testcase_03 AC 16 ms
8,772 KB
testcase_04 AC 15 ms
8,592 KB
testcase_05 AC 16 ms
9,096 KB
testcase_06 AC 15 ms
8,612 KB
testcase_07 AC 14 ms
8,456 KB
testcase_08 AC 16 ms
8,828 KB
testcase_09 AC 15 ms
8,184 KB
testcase_10 AC 16 ms
8,988 KB
testcase_11 AC 14 ms
8,588 KB
testcase_12 AC 16 ms
8,804 KB
testcase_13 AC 17 ms
8,928 KB
testcase_14 AC 13 ms
7,720 KB
testcase_15 AC 13 ms
7,768 KB
testcase_16 AC 17 ms
8,984 KB
testcase_17 AC 17 ms
9,188 KB
testcase_18 AC 18 ms
9,032 KB
testcase_19 AC 18 ms
9,112 KB
testcase_20 WA -
testcase_21 AC 13 ms
7,708 KB
testcase_22 AC 14 ms
7,812 KB
testcase_23 AC 14 ms
7,820 KB
testcase_24 AC 14 ms
7,808 KB
testcase_25 AC 13 ms
7,760 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 16 ms
8,404 KB
testcase_30 AC 16 ms
8,244 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

if __name__ == "__main__":
	L = int(input())
	N = int(input())
	W = sorted(list(map(int, input().split())))
	
	sum = 0
	j = 1
	
	for i in W:
		sum += i
		if sum > L:
			j -= 1
			break
		elif sum == L:
			break
		else:
			j += 1
		
	print(j)
0