![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetCode
CL@NPU
这个作者很懒,什么都没留下…
展开
-
牛顿法求平方根
public int mySqrt(int x) { long a=x; while (a * a > x) { a= (a + x /a) / 2; } return (int) a; }原创 2019-07-18 14:56:30 · 98 阅读 · 0 评论 -
leetCode(51)
n皇后问题研究的是如何将 n个皇后放置在 n×n 的棋盘上,并且使皇后彼此之间不能相互攻击。 上图为 8 皇后问题的一种解法。 给定一个整数 n,返回所有不同的n皇后问题的解决方案。 每一种解法包含一个明确的n 皇后问题的棋子放置方案,该方案中 'Q' 和 '.' 分别代表了皇后和空位。 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/pro...原创 2019-07-17 15:02:36 · 81 阅读 · 0 评论