結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,969 ms
29,872 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 AC 1,991 ms
28,904 KB
testcase_17 AC 1,954 ms
28,832 KB
testcase_18 AC 1,862 ms
28,884 KB
testcase_19 AC 1,961 ms
29,912 KB
testcase_20 AC 1,865 ms
29,936 KB
testcase_21 AC 1,869 ms
29,976 KB
testcase_22 AC 1,675 ms
25,716 KB
testcase_23 AC 1,774 ms
27,904 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=[1e15,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(solve(n,l,k))

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