搜索
文章平均质量分 59
Yang彡
嗯 加油
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU 2199
#include <stdio.h>#include <math.h>double f(double x){ return 8*pow(x,4)+7*pow(x,3)+2*pow(x,2)+3*x+6;}int main(int argc, char *argv[]){ int n; double y; double l,r,m; scanf("%d...原创 2018-10-24 00:33:13 · 315 阅读 · 0 评论 -
在algorithm中的二分查找
首先写algorithm 的头文件lower_boundupper_boundbinary_search从小到大函数lower_bound()在first和last中的前闭后开区间进行二分查找,返回大于或等于val的第一个元素位置。如果所有元素都小于val,则返回last的位置,且last的位置是越界的返回查找元素的第一个可安插位置,也就是“元素值&gt;=查找值”的第一个元素的位置...原创 2018-10-31 09:20:11 · 751 阅读 · 0 评论 -
HDU 2899
Strange fuctionProblem Description Now, here is a fuction:F(x) = 6 * x7+8*x6+7x3+5*x2-yx (0 &amp;amp;lt;= x &amp;amp;lt;=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&amp;lt;r){m=(l+r)/2;if(a[m]==m) return m;else if(a[m]&amp;lt;m) r=m-1;else l=m+1;}return -1;}...原创 2018-11-04 21:00:16 · 408 阅读 · 0 评论
分享