![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分
码代码的小可爱
开心快乐的刷题吧
展开
-
POJ 3273 Monthly Expense(区间和最大值最小-二分)
题目链接:http://poj.org/problem?id=32733273 Monthly ExpenseTime Limit: 2000MS Memory Limit: 65536K Total Submissions: 29200 Accepted: 11090escriptionDescriptionFarmer John is an astounding accounting wi原创 2017-09-16 09:32:59 · 213 阅读 · 0 评论 -
寒假训练报告2.6(二分)
1.从有序数列中查找某个值 O(log n) 算法描述:将值与区间的中点进行比较,不断把解的范围缩小到原来的一半 int Binary_search(int x){ int l = 0, high = n, mid; while(l <= h){ mid = (l + h) >> 1; if(a[mid] == x) return mid;原创 2018-02-06 13:00:07 · 145 阅读 · 0 评论