結果

問題 No.5 数字のブロック
ユーザー ShinAtShinAt
提出日時 2019-07-21 22:00:56
言語 Ruby
(3.3.0)
結果
AC  
実行時間 223 ms / 5,000 ms
コード長 170 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 11,528 KB
実行使用メモリ 15,520 KB
最終ジャッジ日時 2023-09-05 06:44:00
合計ジャッジ時間 5,755 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,016 KB
testcase_01 AC 83 ms
15,068 KB
testcase_02 AC 82 ms
15,144 KB
testcase_03 AC 138 ms
15,412 KB
testcase_04 AC 121 ms
15,264 KB
testcase_05 AC 173 ms
15,520 KB
testcase_06 AC 124 ms
15,400 KB
testcase_07 AC 114 ms
15,144 KB
testcase_08 AC 136 ms
15,388 KB
testcase_09 AC 92 ms
15,020 KB
testcase_10 AC 188 ms
15,260 KB
testcase_11 AC 110 ms
15,308 KB
testcase_12 AC 145 ms
15,488 KB
testcase_13 AC 171 ms
15,464 KB
testcase_14 AC 84 ms
15,088 KB
testcase_15 AC 83 ms
15,216 KB
testcase_16 AC 177 ms
15,480 KB
testcase_17 AC 210 ms
15,460 KB
testcase_18 AC 193 ms
15,360 KB
testcase_19 AC 223 ms
15,412 KB
testcase_20 AC 85 ms
15,088 KB
testcase_21 AC 85 ms
15,068 KB
testcase_22 AC 82 ms
15,072 KB
testcase_23 AC 84 ms
15,076 KB
testcase_24 AC 83 ms
15,124 KB
testcase_25 AC 84 ms
15,124 KB
testcase_26 AC 84 ms
15,168 KB
testcase_27 AC 83 ms
15,244 KB
testcase_28 AC 85 ms
15,096 KB
testcase_29 AC 121 ms
15,200 KB
testcase_30 AC 95 ms
15,156 KB
testcase_31 AC 85 ms
15,128 KB
testcase_32 AC 84 ms
15,000 KB
testcase_33 AC 84 ms
15,092 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

L = gets.to_i
N = gets.to_i
W = gets.split.map(&:to_i)

widths = W.sort!

ans = widths
N.times do
  if ans.sum <= L
    break
  else
    ans.pop
  end
end
puts ans.count
0