上一页 1 ··· 98 99 100 101 102 103 104 105 106 ··· 114 下一页
摘要: public class Solution { public int MySqrt(int x) { long r = x; while (r * r > x) r = (r + x / r) / 2; return (int)r; } } https://leetcode.com/problems 阅读全文
posted @ 2017-04-26 18:58 Sempron2800+ 阅读(210) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/count-primes/#/description 这道题目是意思是,计算比n小的非负数中有多少素数。 例如: n = 7,素数有2,3,5(不包含7)一共3个 n = 8,素数有2,3,5,7一共4个 使用素数筛法可以提高效率。 pyt 阅读全文
posted @ 2017-04-26 18:50 Sempron2800+ 阅读(124) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/third-maximum-number/#/description 阅读全文
posted @ 2017-04-26 18:14 Sempron2800+ 阅读(102) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/k-diff-pairs-in-an-array/#/description 阅读全文
posted @ 2017-04-26 18:04 Sempron2800+ 阅读(88) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/implement-strstr/#/description python实现,不实用内置函数: 作为一道easy题目,提交成功率只有33%,可以看出本题的一些细节需要仔细分析,否则很容易出错。 阅读全文
posted @ 2017-04-26 17:27 Sempron2800+ 阅读(103) 评论(0) 推荐(0) 编辑
摘要: public class MinStack { Stack<int> S = new Stack<int>(); /** initialize your data structure here. */ int min = int.MaxValue; public MinStack() { } pub 阅读全文
posted @ 2017-04-26 17:22 Sempron2800+ 阅读(123) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/range-sum-query-immutable/#/description 补充一个python的实现: 阅读全文
posted @ 2017-04-26 16:51 Sempron2800+ 阅读(98) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public uint reverseBits(uint n) { var list = new List<uint>();//逆序的二进制列表,list[0]是最低位 while (n != 0) { var cur = n % 2; list.Ad 阅读全文
posted @ 2017-04-26 16:32 Sempron2800+ 阅读(114) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/heaters/#/description 阅读全文
posted @ 2017-04-26 16:16 Sempron2800+ 阅读(139) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/nth-digit/#/description 阅读全文
posted @ 2017-04-25 23:48 Sempron2800+ 阅读(323) 评论(0) 推荐(0) 编辑
上一页 1 ··· 98 99 100 101 102 103 104 105 106 ··· 114 下一页