結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー mokomoko
提出日時 2018-03-16 09:40:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 405 bytes
コンパイル時間 580 ms
コンパイル使用メモリ 10,772 KB
実行使用メモリ 30,012 KB
最終ジャッジ日時 2023-09-09 03:07:00
合計ジャッジ時間 34,883 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,195 ms
30,012 KB
testcase_01 WA -
testcase_02 AC 692 ms
16,412 KB
testcase_03 AC 1,320 ms
23,824 KB
testcase_04 AC 1,432 ms
28,892 KB
testcase_05 AC 1,434 ms
28,864 KB
testcase_06 AC 1,285 ms
28,912 KB
testcase_07 AC 1,829 ms
29,876 KB
testcase_08 AC 1,829 ms
29,880 KB
testcase_09 AC 1,562 ms
29,908 KB
testcase_10 AC 1,312 ms
25,688 KB
testcase_11 AC 1,364 ms
28,104 KB
testcase_12 AC 1,118 ms
25,168 KB
testcase_13 AC 1,682 ms
28,376 KB
testcase_14 AC 1,732 ms
28,916 KB
testcase_15 AC 1,337 ms
26,696 KB
testcase_16 AC 1,057 ms
28,876 KB
testcase_17 AC 1,022 ms
28,932 KB
testcase_18 AC 1,010 ms
28,932 KB
testcase_19 AC 1,026 ms
29,908 KB
testcase_20 AC 1,014 ms
29,904 KB
testcase_21 AC 1,014 ms
29,856 KB
testcase_22 AC 903 ms
28,040 KB
testcase_23 AC 955 ms
27,912 KB
testcase_24 AC 15 ms
7,908 KB
testcase_25 AC 53 ms
8,752 KB
testcase_26 AC 30 ms
8,152 KB
testcase_27 AC 26 ms
8,284 KB
testcase_28 AC 311 ms
11,548 KB
testcase_29 AC 168 ms
9,920 KB
testcase_30 AC 56 ms
8,760 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(55):
		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