摘要:
#include<iostream> using namespace std; int main() { double x; cin>>x; double l=0,r=x; while(r-l>1e-8) //for(int i=0;i<100;i++) 可以不用精确位数,直接循环100次 { double mid=(l+r)/2; if(mid*mid>=x) r=mid; else l=mid 阅读全文
posted @ 2019-10-27 11:31
晴屿
阅读(146)
评论(0)
推荐(0)
摘要:
https://www.acwing.com/problem/content/791/ 模板 这两个模板的区别在于去mid的时候是否+1 平时写的时候可以先不写+1, 然后当更新方式为l=mid, r=min-1时,再写上加1 解释+1: 举例子,因为时向下取整,当l=r-1,如果不补上+1,那么m 阅读全文
posted @ 2019-10-27 11:05
晴屿
阅读(235)
评论(0)
推荐(0)
摘要:
模拟 阅读全文
posted @ 2019-10-27 00:31
晴屿
阅读(131)
评论(0)
推荐(0)
摘要:
贪心 阅读全文
posted @ 2019-10-27 00:30
晴屿
阅读(146)
评论(0)
推荐(0)
摘要:
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<queue> const int maxn =100010; using namespace std; int n,m; struct data { int x,step; } p; int vis[1 阅读全文
posted @ 2019-10-27 00:29
晴屿
阅读(144)
评论(0)
推荐(0)
摘要:
三维数组加宽搜 阅读全文
posted @ 2019-10-27 00:28
晴屿
阅读(155)
评论(0)
推荐(0)
摘要:
八方向 深搜 阅读全文
posted @ 2019-10-27 00:28
晴屿
阅读(112)
评论(0)
推荐(0)