結果

問題 No.5 数字のブロック
ユーザー mkco3mkco3
提出日時 2015-06-01 18:53:56
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 241 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 11,448 KB
実行使用メモリ 15,484 KB
最終ジャッジ日時 2023-09-20 18:22:41
合計ジャッジ時間 4,448 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
15,124 KB
testcase_01 AC 86 ms
15,060 KB
testcase_02 WA -
testcase_03 AC 89 ms
15,352 KB
testcase_04 AC 89 ms
15,180 KB
testcase_05 AC 90 ms
15,356 KB
testcase_06 AC 88 ms
15,276 KB
testcase_07 AC 89 ms
15,136 KB
testcase_08 AC 90 ms
15,392 KB
testcase_09 AC 88 ms
15,168 KB
testcase_10 AC 90 ms
15,320 KB
testcase_11 AC 88 ms
15,096 KB
testcase_12 AC 90 ms
15,484 KB
testcase_13 AC 88 ms
15,376 KB
testcase_14 AC 84 ms
15,260 KB
testcase_15 AC 85 ms
15,156 KB
testcase_16 AC 89 ms
15,412 KB
testcase_17 AC 89 ms
15,276 KB
testcase_18 AC 90 ms
15,380 KB
testcase_19 AC 92 ms
15,464 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 85 ms
15,140 KB
testcase_24 AC 85 ms
15,256 KB
testcase_25 AC 85 ms
15,240 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 87 ms
15,044 KB
testcase_30 AC 88 ms
15,256 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

input = gets
width = input.to_i
input = gets
number = input.to_i

input  = gets
block = input.chomp.split(" ")
block.map!(&:to_i)
block.sort!

sum = 0
number.times do |i|
 sum += block[i].to_i
 if sum > width then
   puts i
   break
 end
end
0