結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー mokomoko
提出日時 2018-03-16 09:36:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 30,060 KB
最終ジャッジ日時 2023-08-23 11:41:11
合計ジャッジ時間 54,185 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,098 ms
29,852 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2,026 ms
28,876 KB
testcase_19 AC 2,101 ms
29,860 KB
testcase_20 AC 2,029 ms
29,892 KB
testcase_21 AC 2,038 ms
29,848 KB
testcase_22 AC 1,828 ms
25,828 KB
testcase_23 AC 1,931 ms
28,060 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

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(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(solve(n,l,k))

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