結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー mokomoko
提出日時 2018-03-16 09:35:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 4,865 ms / 5,000 ms
コード長 392 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,880 KB
実行使用メモリ 30,028 KB
最終ジャッジ日時 2023-08-23 11:39:26
合計ジャッジ時間 93,973 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,536 ms
29,952 KB
testcase_01 AC 17 ms
7,944 KB
testcase_02 AC 1,825 ms
16,376 KB
testcase_03 AC 3,511 ms
23,816 KB
testcase_04 AC 4,323 ms
28,780 KB
testcase_05 AC 4,316 ms
28,804 KB
testcase_06 AC 3,979 ms
28,876 KB
testcase_07 AC 4,865 ms
30,020 KB
testcase_08 AC 4,865 ms
29,852 KB
testcase_09 AC 4,433 ms
29,760 KB
testcase_10 AC 3,898 ms
25,712 KB
testcase_11 AC 4,118 ms
28,004 KB
testcase_12 AC 3,445 ms
25,252 KB
testcase_13 AC 4,477 ms
29,008 KB
testcase_14 AC 4,663 ms
28,804 KB
testcase_15 AC 3,793 ms
26,700 KB
testcase_16 AC 3,555 ms
28,752 KB
testcase_17 AC 3,503 ms
28,892 KB
testcase_18 AC 3,312 ms
28,816 KB
testcase_19 AC 3,502 ms
29,760 KB
testcase_20 AC 3,335 ms
30,028 KB
testcase_21 AC 3,339 ms
29,760 KB
testcase_22 AC 2,983 ms
25,752 KB
testcase_23 AC 3,171 ms
27,956 KB
testcase_24 AC 16 ms
7,804 KB
testcase_25 AC 115 ms
8,588 KB
testcase_26 AC 52 ms
8,256 KB
testcase_27 AC 40 ms
8,360 KB
testcase_28 AC 805 ms
11,416 KB
testcase_29 AC 412 ms
9,824 KB
testcase_30 AC 119 ms
8,752 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+=int(l[i]//mid)
	return cnt>=k

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

def main():
	n,l,k=INPUT()
	print(solve(n,l,k))

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