結果

問題 No.67 よくある棒を切る問題 (1)
ユーザー Bs_bekkuBs_bekku
提出日時 2020-03-29 07:39:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,253 ms / 5,000 ms
コード長 352 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 32,800 KB
最終ジャッジ日時 2024-04-26 01:00:14
合計ジャッジ時間 36,927 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,034 ms
32,700 KB
testcase_01 AC 28 ms
10,880 KB
testcase_02 AC 857 ms
19,040 KB
testcase_03 AC 1,603 ms
26,588 KB
testcase_04 AC 1,897 ms
29,236 KB
testcase_05 AC 1,877 ms
29,372 KB
testcase_06 AC 1,535 ms
29,404 KB
testcase_07 AC 2,253 ms
32,800 KB
testcase_08 AC 2,228 ms
32,792 KB
testcase_09 AC 1,773 ms
32,672 KB
testcase_10 AC 1,704 ms
26,704 KB
testcase_11 AC 1,813 ms
28,556 KB
testcase_12 AC 1,344 ms
25,940 KB
testcase_13 AC 2,041 ms
31,160 KB
testcase_14 AC 2,148 ms
31,724 KB
testcase_15 AC 1,557 ms
29,404 KB
testcase_16 AC 1,103 ms
29,368 KB
testcase_17 AC 1,033 ms
29,352 KB
testcase_18 AC 959 ms
29,360 KB
testcase_19 AC 940 ms
32,676 KB
testcase_20 AC 925 ms
32,664 KB
testcase_21 AC 928 ms
32,796 KB
testcase_22 AC 882 ms
27,672 KB
testcase_23 AC 923 ms
28,560 KB
testcase_24 AC 30 ms
10,752 KB
testcase_25 AC 82 ms
11,136 KB
testcase_26 AC 49 ms
10,880 KB
testcase_27 AC 43 ms
10,880 KB
testcase_28 AC 402 ms
14,188 KB
testcase_29 AC 229 ms
12,544 KB
testcase_30 AC 83 ms
11,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
l=list(map(int,input().split()))
k=int(input())

left=0
right=max(l)+1
def wari(m,l,k):
  ans=0
  for i in l:
    ans+=i//m
  if ans<k:
    return True
  else:
    return False
while True:
  mid=(left+right)/2
  if wari(mid,l,k):
    if mid==right:
      break
    right=mid
  else:
    if mid==left:
      break
    left=mid
print(left)
0