結果

問題 No.5 数字のブロック
ユーザー rkyrky
提出日時 2017-11-04 13:54:49
言語 Ruby
(3.2.2)
結果
AC  
実行時間 81 ms / 5,000 ms
コード長 187 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 11,308 KB
実行使用メモリ 15,584 KB
最終ジャッジ日時 2023-08-11 17:54:31
合計ジャッジ時間 4,989 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
15,240 KB
testcase_01 AC 75 ms
15,276 KB
testcase_02 AC 73 ms
15,064 KB
testcase_03 AC 77 ms
15,300 KB
testcase_04 AC 77 ms
15,364 KB
testcase_05 AC 78 ms
15,504 KB
testcase_06 AC 76 ms
15,312 KB
testcase_07 AC 71 ms
15,548 KB
testcase_08 AC 80 ms
15,372 KB
testcase_09 AC 75 ms
15,276 KB
testcase_10 AC 75 ms
15,388 KB
testcase_11 AC 76 ms
15,408 KB
testcase_12 AC 77 ms
15,284 KB
testcase_13 AC 80 ms
15,512 KB
testcase_14 AC 74 ms
15,072 KB
testcase_15 AC 73 ms
15,136 KB
testcase_16 AC 77 ms
15,460 KB
testcase_17 AC 75 ms
15,312 KB
testcase_18 AC 78 ms
15,408 KB
testcase_19 AC 81 ms
15,584 KB
testcase_20 AC 75 ms
15,092 KB
testcase_21 AC 75 ms
15,084 KB
testcase_22 AC 76 ms
15,120 KB
testcase_23 AC 76 ms
15,020 KB
testcase_24 AC 77 ms
15,264 KB
testcase_25 AC 76 ms
15,048 KB
testcase_26 AC 75 ms
15,064 KB
testcase_27 AC 77 ms
15,044 KB
testcase_28 AC 77 ms
15,260 KB
testcase_29 AC 78 ms
15,504 KB
testcase_30 AC 76 ms
15,192 KB
testcase_31 AC 75 ms
15,304 KB
testcase_32 AC 75 ms
15,056 KB
testcase_33 AC 75 ms
15,112 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:2: warning: assigned but unused variable - test_case
Syntax OK

ソースコード

diff #

width = gets.chomp.to_i
test_case = gets.chomp.to_i
list = gets.chomp.split.map(&:to_i).sort!
sum, count = 0, 0
list.each do |i|
	sum += i
	break if sum > width
	count += 1
end
puts count
0