摘要: 数字开方,求平方根算法 二分查找 大致的逻辑是这样的: 比如对6求开方 初始化 low=0,high=6 mid=(low+hight)/6=3,3*3 = 9 > 6,那么上限high = 3, mid =(0+3)/2=1.5, 1.5*1.5 = 2.25 < 6,那么更新下限 low = 1 阅读全文
posted @ 2020-09-04 17:57 real-zhouyc 阅读(463) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <vector> #include <string> #include <algorithm> #include <climits> #include <deque> using namespace std; struct Node{ int 阅读全文
posted @ 2020-09-04 15:41 real-zhouyc 阅读(90) 评论(0) 推荐(0) 编辑