当前位置:网站首页>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 .
边栏推荐
- Fu Yingna: Yuan universe is the new generation of Internet!
- Implementation of jump connection of RESNET (pytorch)
- Install the laser of ROS_ scan_ Problems encountered in match library (I)
- How to query the submission number of a version
- "Weilai Cup" 2022 Niuke summer multi school training camp 1 J serval and essay (heuristic merger)
- Leftmost prefix principle of index
- Openfeign asynchronous call problem
- [common commands]
- The structure pointer must be initialized, and the pointer must also be initialized
- LCA 板子
猜你喜欢

全屋WiFi方案:Mesh路由器组网和AC+AP

rman不标记过期备份

伏英娜:元宇宙就是新一代互联网!

信号处理中的反傅里叶变换(IFFT)原理

不会就坚持68天吧 狒狒吃香蕉

2021 sist summer camp experience + record post of School of information, Shanghai University of science and technology

从淘宝,天猫,1688,微店,京东,苏宁,淘特等其他平台一键复制商品到拼多多平台(批量上传宝贝详情接口教程)

Applet: Area scrolling, pull-down refresh, pull-up load more

顺序表和链表

15.federation
随机推荐
AssertionError(“Torch not compiled with CUDA enabled“)
Value transmission and address transmission of C language, pointer of pointer
10. Fallback message
Function pointer and callback function
The principle of inverse Fourier transform (IFFT) in signal processing
Can you really write restful API?
如何查询版本的提交号
安装postgis时报找不到“POSTGIS_VERSION”这个函数
Not for 58 days. Implement prefix tree
How to execute insert into select from job in SQL client
What the hell is this error? It doesn't affect the execution result, but it always reports errors when executing SQL... Connecting maxcomputer uses
Database SQL statement realizes function query of data decomposition
淘宝商品详情接口(商品详情页面数据接口)
GBase 8a特殊场景下屏蔽 ODBC 负载均衡方式?
MPU6050
Code or script to speed up the video playback of video websites
Mmdetection preliminary use
Problems encountered in vscode connection SSH
Whole house WiFi solution: mesh router networking and ac+ap
[material delivery UAV] record (ROS + Px4 + yolov5 + esp8266 + steering gear)