三分查找
文章平均质量分 59
Yang彡
嗯 加油
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 2899
Strange fuction Problem Description Now, here is a fuction: F(x) = 6 * x7+8*x6+7x3+5*x2-yx (0 <= x <=100) Can you find the minimum value when x is between 0 and 100. Inp...原创 2018-11-04 12:23:31 · 311 阅读 · 0 评论 -
二分与三分查找模板
二分查找 a[] 是有序的 成升序或降序 int find(int a[])//假定是在0到100之间搜索 l取最左边 r 取最右边 { int l=0; int r=100; int m; while(l<r) { m=(l+r)/2; if(a[m]==m) return m; else if(a[m]<m) r=m-1; else l=m+1; } return -1; } ...原创 2018-11-04 21:00:16 · 408 阅读 · 0 评论
分享