結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー takakintakakin
提出日時 2020-05-03 20:23:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 4,157 ms / 5,000 ms
コード長 312 bytes
コンパイル時間 440 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 33,268 KB
最終ジャッジ日時 2024-04-26 01:07:37
合計ジャッジ時間 69,503 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,195 ms
33,268 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 1,039 ms
19,032 KB
testcase_03 AC 1,976 ms
26,704 KB
testcase_04 AC 2,737 ms
29,352 KB
testcase_05 AC 2,722 ms
29,480 KB
testcase_06 AC 2,608 ms
29,348 KB
testcase_07 AC 2,712 ms
32,784 KB
testcase_08 AC 2,714 ms
32,656 KB
testcase_09 AC 2,629 ms
32,660 KB
testcase_10 AC 2,453 ms
27,696 KB
testcase_11 AC 2,593 ms
28,544 KB
testcase_12 AC 2,262 ms
26,964 KB
testcase_13 AC 2,483 ms
31,140 KB
testcase_14 AC 2,584 ms
32,132 KB
testcase_15 AC 2,239 ms
29,396 KB
testcase_16 AC 4,157 ms
29,356 KB
testcase_17 AC 4,149 ms
29,344 KB
testcase_18 AC 3,590 ms
29,348 KB
testcase_19 AC 3,971 ms
32,656 KB
testcase_20 AC 3,517 ms
32,656 KB
testcase_21 AC 3,537 ms
32,656 KB
testcase_22 AC 1,794 ms
27,648 KB
testcase_23 AC 3,428 ms
28,544 KB
testcase_24 AC 30 ms
10,752 KB
testcase_25 AC 81 ms
11,136 KB
testcase_26 AC 49 ms
11,008 KB
testcase_27 AC 43 ms
10,752 KB
testcase_28 AC 458 ms
14,180 KB
testcase_29 AC 242 ms
12,408 KB
testcase_30 AC 84 ms
11,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
L=[int(i) for i in input().split()]
k=int(input())

def chk(x):
  ct=0
  for ln in L:
    ct+=int(ln/x)
  return ct>=k

l,r=0,max(L)
t=0
while r-l>10**(-9) and t<=10**2:
  mid=(l+r)/2
  if chk(mid):
    l=mid
  else:
    r=mid
  t+=1
print(l)
0