結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー 双六双六
提出日時 2020-07-26 16:59:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,610 ms / 5,000 ms
コード長 643 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 82,416 KB
実行使用メモリ 103,700 KB
最終ジャッジ日時 2024-04-26 01:09:01
合計ジャッジ時間 23,322 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 681 ms
103,244 KB
testcase_01 AC 44 ms
61,940 KB
testcase_02 AC 598 ms
78,596 KB
testcase_03 AC 1,112 ms
93,040 KB
testcase_04 AC 1,084 ms
102,036 KB
testcase_05 AC 1,077 ms
101,484 KB
testcase_06 AC 837 ms
101,456 KB
testcase_07 AC 1,521 ms
103,596 KB
testcase_08 AC 1,610 ms
103,428 KB
testcase_09 AC 1,207 ms
103,700 KB
testcase_10 AC 980 ms
97,336 KB
testcase_11 AC 1,034 ms
101,184 KB
testcase_12 AC 744 ms
97,936 KB
testcase_13 AC 1,396 ms
99,956 KB
testcase_14 AC 1,451 ms
102,808 KB
testcase_15 AC 1,048 ms
99,820 KB
testcase_16 AC 496 ms
101,488 KB
testcase_17 AC 439 ms
100,752 KB
testcase_18 AC 415 ms
100,632 KB
testcase_19 AC 570 ms
103,112 KB
testcase_20 AC 426 ms
102,732 KB
testcase_21 AC 424 ms
102,996 KB
testcase_22 AC 376 ms
96,424 KB
testcase_23 AC 402 ms
100,904 KB
testcase_24 AC 40 ms
53,940 KB
testcase_25 AC 81 ms
63,252 KB
testcase_26 AC 61 ms
63,496 KB
testcase_27 AC 55 ms
61,608 KB
testcase_28 AC 294 ms
69,852 KB
testcase_29 AC 178 ms
65,580 KB
testcase_30 AC 84 ms
63,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

def Binary_Search(L, N, K):
	#初期化
	left = 0
	right = 10 ** 9
	ans = 0
	
	#二分探索
	for i in range(70):
		mid = (left + right) / 2
		val = 0
		for j in L:
			val += int(j // mid)
		if val >= K:
			ans = max(ans, mid)
			left = mid
		else:
			right = mid

	return ans

#処理内容
def main():
	N = int(input())
	L = getlist()
	K = int(input())
	ans = Binary_Search(L, N, K)
	print(ans)
	




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