当前位置:网站首页>Not 67 days, square root
Not 67 days, square root
2022-07-29 04:16:00 【A little Ming】

class Solution {
public int mySqrt(int x) {
int l = 0, r = x, ans = -1;
while (l <= r) {
int mid = l + (r - l) / 2;
if ((long) mid * mid <= x) {
ans = mid;
l = mid + 1;
} else {
r = mid - 1;
}
}
return ans;
}
}
author :LeetCode-Solution
link :https://leetcode.cn/problems/jJ0w9p/solution/qiu-ping-fang-gen-by-leetcode-solution-ybnw/
source : Power button (LeetCode)
The copyright belongs to the author . Commercial reprint please contact the author for authorization , Non-commercial reprint please indicate the source .
边栏推荐
- 有没有大佬帮我看下flink sql连接kafka认证kerberos的参数配置是否有误
- [paper translation] vectornet: encoding HD maps and agent dynamics from vectorized representation
- Machine vision Series 1: Visual Studio 2019 dynamic link library DLL establishment
- [common commands]
- 数据集成这个地方的过滤条件该咋写,用的啥语法?sql语法处理bizdate可以不
- The solution of porting stm32f103zet6 program to c8t6+c8t6 download program flash timeout
- Record of problems encountered in ROS learning
- 11.备份交换机
- 信号处理中的反傅里叶变换(IFFT)原理
- MySQL gets the maximum value record by field grouping
猜你喜欢

Class starts! See how smardaten decomposes complex business scenarios

Object detection: object_ Detection API +ssd target detection model

通过js来实现一元二次方程的效果,输入a,b,c系数后可计算出x1和x2的值

不会就坚持64天吧 查找插入位置

14.haproxy+keepalived负载均衡和高可用

不会就坚持62天吧 单词之和

Const char* and char*, string constants

AssertionError(“Torch not compiled with CUDA enabled“)

Jenkins 参数化构建中 各参数介绍与示例

10.回退消息
随机推荐
店铺排名问题,如何解决?
[kvm] create virtual machine from kickstart file
不会就坚持64天吧 查找插入位置
伏英娜:元宇宙就是新一代互联网!
Machine vision Series 2: vs DLL debugging
Machine vision series 3:vs2019 opencv environment configuration
"Weilai Cup" 2022 Niuke summer multi school training camp 2H
Fuzzy query of SQL
Leftmost prefix principle of index
Locally call tensorboard and Jupiter notebook on the server (using mobaxterm)
SQL server how to judge when the parameter received by the stored procedure is of type int?
11.备份交换机
通过js来实现一元二次方程的效果,输入a,b,c系数后可计算出x1和x2的值
The pit I walked through: the first ad Sketchpad
Methods of using multiple deformations on an element
SQL time fuzzy query datediff() function
Implementation of jump connection of RESNET (pytorch)
信号处理中的反傅里叶变换(IFFT)原理
MySQL gets the maximum value record by field grouping
Pat a1069/b1019 the black hole of numbers