結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー 👑 horiesinitihoriesiniti
提出日時 2023-02-11 00:23:57
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,763 ms / 5,000 ms
コード長 339 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 11,460 KB
実行使用メモリ 28,720 KB
最終ジャッジ日時 2023-09-22 01:01:25
合計ジャッジ時間 42,643 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,699 ms
28,720 KB
testcase_01 AC 83 ms
15,136 KB
testcase_02 AC 689 ms
20,248 KB
testcase_03 AC 1,259 ms
24,928 KB
testcase_04 AC 1,763 ms
27,956 KB
testcase_05 AC 1,699 ms
27,880 KB
testcase_06 AC 1,693 ms
27,768 KB
testcase_07 AC 1,690 ms
28,472 KB
testcase_08 AC 1,703 ms
28,664 KB
testcase_09 AC 1,699 ms
28,416 KB
testcase_10 AC 1,531 ms
26,480 KB
testcase_11 AC 1,676 ms
27,204 KB
testcase_12 AC 1,478 ms
26,016 KB
testcase_13 AC 1,564 ms
27,200 KB
testcase_14 AC 1,674 ms
27,704 KB
testcase_15 AC 1,459 ms
26,348 KB
testcase_16 AC 1,701 ms
27,924 KB
testcase_17 AC 1,703 ms
27,764 KB
testcase_18 AC 1,699 ms
27,708 KB
testcase_19 AC 1,692 ms
28,376 KB
testcase_20 AC 1,720 ms
28,488 KB
testcase_21 AC 1,697 ms
28,508 KB
testcase_22 AC 1,545 ms
26,340 KB
testcase_23 AC 1,678 ms
27,024 KB
testcase_24 AC 84 ms
15,128 KB
testcase_25 AC 116 ms
15,304 KB
testcase_26 AC 100 ms
15,044 KB
testcase_27 AC 94 ms
15,260 KB
testcase_28 AC 344 ms
17,224 KB
testcase_29 AC 213 ms
15,844 KB
testcase_30 AC 117 ms
15,360 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:21: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

def f(l,xs)
	ans=0
	xs.each{|x|
		ans+=(x/l).to_i
	}
	return ans
end
def fb(l,r,k,xs,d)
	if d>77then
		return l
	else
		m=(l+r)/2.0
		k2=f(m,xs)
		if k2<k then
			return fb(l,m,k,xs,d+1)
		else
			return fb(m,r,k,xs,d+1)
		end
	end
end
n=gets.to_i
xs=gets.split(" ").map{|e| e.to_f}
k=gets.to_i
puts sprintf("%0.11f",fb(0.0,xs.max,k,xs,0))
0