上一页 1 2 3 4 5 6 7 ··· 35 下一页

2019年5月19日

Tensorflow_入门学习_1

摘要: 1.0 TensorFlow graphs Tensorflow是基于graph based computation: 如: a=(b+c)∗(c+2) 可分解为 d=b+c e=c+2 a=d∗e 这样做的目的在于,d=b+c,e=c+2,这两个式子就可以并行地计算。 2.0 A Simple T 阅读全文

posted @ 2019-05-19 19:35 JASONlee3 阅读(168) 评论(0) 推荐(0) 编辑

leetcode_1049. Last Stone Weight II_[DP]

摘要: 1049. Last Stone Weight II https://leetcode.com/problems/last-stone-weight-ii/ 题意:从一堆石头里任选两个石头s1,s2,若s1==s2,则两个石头都被销毁,否则加入s1<s2,剩下一块重量为s2-s1的石头。重复上面的操 阅读全文

posted @ 2019-05-19 18:08 JASONlee3 阅读(772) 评论(0) 推荐(0) 编辑

leetcode_1048. Longest String Chain_[DP,动态规划,记忆化搜索]

摘要: 1048. Longest String Chain https://leetcode.com/problems/longest-string-chain/ Let's say word1 is a predecessor of word2 if and only if we can add exa 阅读全文

posted @ 2019-05-19 13:22 JASONlee3 阅读(197) 评论(0) 推荐(0) 编辑

2019年5月8日

leetcode_1033. Moving Stones Until Consecutive

摘要: https://leetcode.com/problems/moving-stones-until-consecutive/ 题意:给定3个点,每次从两个端点(位置最小或位置最大)中挑选一个点进行移动,将其移动到原先两个端点之间的空位置上,直到3个点位置连续,问最少多少步,和最多多少步。 思路: 对 阅读全文

posted @ 2019-05-08 18:17 JASONlee3 阅读(111) 评论(0) 推荐(0) 编辑

2019年5月5日

leetcode_1039. Minimum Score Triangulation of Polygon_动态规划

摘要: https://leetcode.com/problems/minimum-score-triangulation-of-polygon/ 题意:给定一个凸的N边形(N<=50),每个顶点有一个权值A[i],把它分为N-2个三角形,每个三角形的val等于三个顶点的权值的乘积,问划分之后图形的val总 阅读全文

posted @ 2019-05-05 17:59 JASONlee3 阅读(324) 评论(0) 推荐(0) 编辑

2019年5月2日

leetcode_935. Knight Dialer_动态规划_矩阵快速幂

摘要: https://leetcode.com/problems/knight-dialer/ 在如下图的拨号键盘上,初始在键盘中任意位置,按照国际象棋中骑士(中国象棋中马)的走法走N-1步,能拨出多少种不同的号码。 解法一:动态规划,逆向搜索 解法二:动态规划,正向递推 问题一:要构造10次二维的vec 阅读全文

posted @ 2019-05-02 13:15 JASONlee3 阅读(367) 评论(0) 推荐(0) 编辑

2019年4月26日

leetcode_268.missing number

摘要: 给定一个数组nums,其中包含0--n中的n个数,找到数组中没有出现的那个数。 解法一:cyclic swapping algorithm 解法二:用(1+n)*n/2减掉数组中所有数,就是没有出现的那个数。 解法三:使用异或运算符,a^b^b=a。 阅读全文

posted @ 2019-04-26 21:23 JASONlee3 阅读(146) 评论(0) 推荐(0) 编辑

leetcode_41. First Missing Positive_cyclic swapping

摘要: https://leetcode.com/problems/first-missing-positive/ 给定一个长度为len的无序数组nums,找到其第一个丢失的正整数。 解法: 使用cyclic swapping algorithm。将满足条件 0 < num <= nums.size()的n 阅读全文

posted @ 2019-04-26 20:56 JASONlee3 阅读(144) 评论(0) 推荐(0) 编辑

2019年4月24日

cyclic swapping algorithm

摘要: 原文见:https://leetcode.com/problems/couples-holding-hands/discuss/113362/JavaC%2B%2B-O(N)-solution-using-cyclic-swapping 一、问题引入 假设有一个长度为N的数组nums包含0—N-1的 阅读全文

posted @ 2019-04-24 17:43 JASONlee3 阅读(316) 评论(0) 推荐(0) 编辑

2019年4月21日

leetcode_919. Complete Binary Tree Inserter_完全二叉树插入

摘要: https://leetcode.com/problems/complete-binary-tree-inserter/ 给出树节点的定义和完全二叉树插入器类的定义,为这个类补全功能。完全二叉树的定义为:这颗二叉树除最后一层外左右层的节点都是满的(对于第i层有2^(i-1)个节点),最后一层节点都出 阅读全文

posted @ 2019-04-21 21:37 JASONlee3 阅读(151) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 35 下一页

导航