結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー wotsushiwotsushi
提出日時 2017-04-12 18:45:59
言語 Ruby
(3.3.0)
結果
AC  
実行時間 3,054 ms / 5,000 ms
コード長 220 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 87,168 KB
最終ジャッジ日時 2024-04-25 23:51:44
合計ジャッジ時間 70,862 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,034 ms
87,168 KB
testcase_01 AC 90 ms
12,416 KB
testcase_02 AC 1,215 ms
61,696 KB
testcase_03 AC 2,217 ms
82,432 KB
testcase_04 AC 3,027 ms
86,400 KB
testcase_05 AC 3,026 ms
86,272 KB
testcase_06 AC 3,054 ms
86,272 KB
testcase_07 AC 3,014 ms
86,784 KB
testcase_08 AC 3,004 ms
86,784 KB
testcase_09 AC 3,018 ms
86,912 KB
testcase_10 AC 2,725 ms
82,944 KB
testcase_11 AC 2,869 ms
86,912 KB
testcase_12 AC 2,614 ms
82,688 KB
testcase_13 AC 2,759 ms
83,328 KB
testcase_14 AC 2,867 ms
86,272 KB
testcase_15 AC 2,550 ms
82,560 KB
testcase_16 AC 2,997 ms
86,272 KB
testcase_17 AC 2,984 ms
86,400 KB
testcase_18 AC 2,973 ms
86,400 KB
testcase_19 AC 2,963 ms
86,912 KB
testcase_20 AC 2,954 ms
86,784 KB
testcase_21 AC 2,951 ms
86,912 KB
testcase_22 AC 2,679 ms
82,944 KB
testcase_23 AC 2,821 ms
86,016 KB
testcase_24 AC 87 ms
12,288 KB
testcase_25 AC 148 ms
15,232 KB
testcase_26 AC 111 ms
12,544 KB
testcase_27 AC 103 ms
12,800 KB
testcase_28 AC 560 ms
30,208 KB
testcase_29 AC 323 ms
25,472 KB
testcase_30 AC 152 ms
15,360 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
L = gets.split.map(&:to_i)
K = gets.to_i
ans = (1..(100)).inject([0.0, L.max]) {|(i, s), _|
  c = (s + i) / 2
  if L.map {|l| (l / c).floor}.inject(:+) >= K
    [c, s]
  else
    [i, c]
  end
}[0]
puts ans
0