結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー mokomoko
提出日時 2018-04-27 23:37:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,369 ms / 5,000 ms
コード長 404 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 32,808 KB
最終ジャッジ日時 2024-04-26 00:30:35
合計ジャッジ時間 43,714 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,609 ms
32,664 KB
testcase_01 AC 29 ms
10,752 KB
testcase_02 AC 894 ms
19,184 KB
testcase_03 AC 1,712 ms
26,472 KB
testcase_04 AC 1,947 ms
29,384 KB
testcase_05 AC 1,942 ms
29,376 KB
testcase_06 AC 1,796 ms
29,372 KB
testcase_07 AC 2,332 ms
32,684 KB
testcase_08 AC 2,369 ms
32,808 KB
testcase_09 AC 2,069 ms
32,688 KB
testcase_10 AC 1,781 ms
27,672 KB
testcase_11 AC 1,850 ms
28,568 KB
testcase_12 AC 1,556 ms
26,988 KB
testcase_13 AC 2,151 ms
31,300 KB
testcase_14 AC 2,211 ms
31,948 KB
testcase_15 AC 1,781 ms
29,420 KB
testcase_16 AC 1,567 ms
29,380 KB
testcase_17 AC 1,511 ms
29,364 KB
testcase_18 AC 1,481 ms
29,500 KB
testcase_19 AC 1,450 ms
32,684 KB
testcase_20 AC 1,445 ms
32,676 KB
testcase_21 AC 1,424 ms
32,684 KB
testcase_22 AC 1,336 ms
27,676 KB
testcase_23 AC 1,412 ms
28,692 KB
testcase_24 AC 30 ms
10,752 KB
testcase_25 AC 78 ms
11,264 KB
testcase_26 AC 48 ms
11,008 KB
testcase_27 AC 43 ms
10,880 KB
testcase_28 AC 410 ms
14,200 KB
testcase_29 AC 225 ms
12,416 KB
testcase_30 AC 81 ms
11,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def INPUT():
	n=int(input())
	l=list(map(int,input().split()))
	k=int(input())
	return n,l,k

def ok(mid,n,l,k):
	cnt=0
	for i in range(n):
		cnt+=l[i]//mid
	return cnt>=k

def solve(n,l,k):
	ub,lb=[max(l),0]
	for i in range(60):
		mid=(ub+lb)/2
		if ok(mid,n,l,k):
			lb=mid
		else:
			ub=mid
	return lb

def main():
	n,l,k=INPUT()
	print("{:.20}".format(solve(n,l,k)))

if __name__=="__main__":
	main()
0