結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー wotsushiwotsushi
提出日時 2017-04-12 18:44:02
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 219 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 11,528 KB
実行使用メモリ 87,828 KB
最終ジャッジ日時 2023-09-25 13:08:55
合計ジャッジ時間 41,351 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,602 ms
87,812 KB
testcase_01 WA -
testcase_02 AC 651 ms
35,536 KB
testcase_03 AC 1,182 ms
66,632 KB
testcase_04 AC 1,604 ms
87,016 KB
testcase_05 AC 1,594 ms
87,068 KB
testcase_06 AC 1,596 ms
86,828 KB
testcase_07 AC 1,597 ms
87,828 KB
testcase_08 AC 1,597 ms
87,660 KB
testcase_09 AC 1,597 ms
87,732 KB
testcase_10 AC 1,447 ms
82,824 KB
testcase_11 AC 1,524 ms
86,500 KB
testcase_12 AC 1,391 ms
78,740 KB
testcase_13 AC 1,473 ms
84,368 KB
testcase_14 AC 1,512 ms
87,392 KB
testcase_15 AC 1,376 ms
78,396 KB
testcase_16 AC 1,593 ms
87,056 KB
testcase_17 AC 1,593 ms
86,860 KB
testcase_18 AC 1,596 ms
86,904 KB
testcase_19 AC 1,594 ms
87,652 KB
testcase_20 AC 1,593 ms
87,768 KB
testcase_21 AC 1,598 ms
87,752 KB
testcase_22 AC 1,443 ms
82,984 KB
testcase_23 AC 1,517 ms
86,752 KB
testcase_24 AC 78 ms
15,148 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 86 ms
15,380 KB
testcase_28 AC 319 ms
29,568 KB
testcase_29 AC 196 ms
22,116 KB
testcase_30 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
L = gets.split.map(&:to_i)
K = gets.to_i
ans = (1..(50)).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