- 3
- 0
- 约4.32千字
- 约 5页
- 2018-06-27 发布于河南
- 举报
三分查找技术
【标准化说明】三分查找技术与简单应用
三分查找技术适用于答案在某一个区间内,这个区间的特点的是,以答案为分点的两侧区间都单调的增大或者减小:
如右图就是一个分的例子:
三分的区间为[l,r] 其中最低点为答案
每次把区间分为3个等分
取x1=l+(r-l)/3 ,x2=r-(r-l)/3 作为分点,看谁更接近标准答案,并以此来更新左右区间,继续进行二分,直到得到(无限逼近)答案。
Trick or Treat
Description
Johnny and his friends have decided to spend Halloween night doing the usual candy collection from the households of their village. As the village is too big for a single group to collect the candy from all houses sequentially, Johnny and his friends have decided to split up so that each of them go
原创力文档

文档评论(0)