- 博客(7)
- 资源 (2)
- 收藏
- 关注
原创 LeetCode—376. Wiggle Subsequence
Wiggle Subsequence思路:贪心算法,每次只要跟前一个比,如果符合条件,则获取,如果不符合条件,说明提升了可以比较的空间GitHub地址:https://github.com/corpsepiges/leetcode目前java版本的答案大约进度是免费的差40题,python大约是一半,其他的等以后再补充。点此进入如果可以的话,请点一下star,谢
2016-07-26 10:04:33 647
原创 LeetCode—377. Combination Sum IV
Combination Sum IV思路:动态规划。GitHub地址:https://github.com/corpsepiges/leetcode目前java版本的答案大约进度是免费的差40题,python大约是一半,其他的等以后再补充。点此进入如果可以的话,请点一下star,谢谢。public class Solution { p
2016-07-25 12:08:55 1672
原创 LeetCode—375. Guess Number Higher or Lower II
Guess Number Higher or Lower II思路:刚开始的时候想到的不是动态规划,而是在(s,e)的范围内求出m,使得(s,m-1)=(m+1,e),结果发现两个问题,一个是不能使得两边相等时m靠左还是右,第二个问题更严重,因为题目中表示最后猜对的那一次是不要成本的。。。后来参考下,还是用dp来做。动态规划方程:matrix[s][e]=m+Math.max(matrix[s
2016-07-18 17:09:46 2032
原创 LeetCode—374. Guess Number Higher or Lower
Guess Number Higher or Lower思路:非常简单,就是二分法,注意二分的时候别超过int上限即可。GitHub地址:https://github.com/corpsepiges/leetcode点此进入/* The guess API is defined in the parent class GuessGame. @param n
2016-07-13 15:22:05 638
原创 LeetCode—372. Super Pow
Super Pow思路:利用两条公式 (ak+b)(ck+d)%k=bd; a^b(假设b为偶数)=(a^(b/2))*a^(b/2);GitHub地址:https://github.com/corpsepiges/leetcode点此进入public class Solution { public int superPow(int
2016-07-12 09:46:58 643
原创 LeetCode—373. Find K Pairs with Smallest Sums
Find K Pairs with Smallest Sums思路:最简单的方法,写一个比较规则,直接比较GitHub地址:https://github.com/corpsepiges/leetcode点此进入public class Solution { public List kSmallestPairs(int[] nums1, int[] nums2, in
2016-07-08 11:03:27 630
原创 LeetCode—371. Sum of Two Integers
Sum of Two Integers思路:利用易或和与操作GitHub地址:https://github.com/corpsepiges/leetcode点此进入public class Solution { public int getSum(int a, int b) { return b==0?a:getSum(a^b,(a&b)<<
2016-07-08 10:43:22 215
2积分系列——经典算法与人工智能在外卖物流调度中的应用
2018-04-26
Outlier Analysis 2nd Edition.pdf ——2积分系列
2018-03-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人