diff --git a/8.21/B-Light/Readme.md b/8.21/B-Light/Readme.md index cc02b16..2c96c92 100644 --- a/8.21/B-Light/Readme.md +++ b/8.21/B-Light/Readme.md @@ -1,12 +1,16 @@ # 题目 * 链接 ### 题意 - +如图,求L +![](look) ### 做法 - +三分 +mid=(l+r)/2; +midr(mid+r)/2; +远离峰值的收缩 ### 关键词 - +三分 ### 易错点 -* +* 起始位置 ### 工具箱 * \ No newline at end of file diff --git a/8.21/B-Light/look b/8.21/B-Light/look new file mode 100644 index 0000000..c22648f Binary files /dev/null and b/8.21/B-Light/look differ diff --git a/8.21/B-Light/main.cpp b/8.21/B-Light/main.cpp index 61c413f..1d58774 100644 --- a/8.21/B-Light/main.cpp +++ b/8.21/B-Light/main.cpp @@ -3,29 +3,33 @@ #include #include using namespace std; -//const int N=1e8+5; -//void initialise(int n) -//{ -// -//} +const double eps= 1e-5; +double H,h,D; +double f(double d) +{ + return D-d+H-(H-h)*D/d; +// return D-d+h-(H-h)*(D-d)/d; +} +double sanfen(double l,double r) +{ + double mid,midr,ans; + while(fabs(r-l)>eps) + { + mid=(l+r)/2; + midr=(mid+r)/2; + if(f(mid)0) - { - printf("%.3lf\n",h+add); - } - else - { - printf("%.3lf\n",h); - } + printf("%.3lf\n",sanfen(D-D*h/H,D)); } return 0; } diff --git a/8.21/B-Light/tempCodeRunnerFile.cpp b/8.21/B-Light/tempCodeRunnerFile.cpp new file mode 100644 index 0000000..02358d2 --- /dev/null +++ b/8.21/B-Light/tempCodeRunnerFile.cpp @@ -0,0 +1 @@ +D \ No newline at end of file diff --git a/8.21/E-typewriter/E.pdf b/8.21/E-typewriter/E.pdf new file mode 100644 index 0000000..564d7e7 --- /dev/null +++ b/8.21/E-typewriter/E.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83f6580cee8072a9e6418879a4389386696de7e13230f6b99ee194017c5e1484 +size 117561