![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
力扣
小小怪中式咖啡
这个作者很懒,什么都没留下…
展开
-
978. 最长湍流子数组
题目链接:https://leetcode-cn.com/contest/weekly-contest-120/problems/longest-turbulent-subarray/滑动窗口法(参考 力扣阅读)#include <iostream>#include <cstdio>#include <algorithm>#include &...原创 2019-01-25 05:51:27 · 224 阅读 · 0 评论 -
984. 不含 AAA 或 BBB 的字符串
题目链接:https://leetcode-cn.com/contest/weekly-contest-121/problems/string-without-aaa-or-bbb/AC代码:#include <iostream>#include <cstdio>#include <cstring>#include <string>...原创 2019-02-03 12:33:20 · 200 阅读 · 0 评论 -
46 全排列
题目链接:https://leetcode-cn.com/problems/permutations/主要是考察递归AC代码:#include <iostream>#include <vector>#include <algorithm>#include <cstdio>using namespace std;int n...原创 2019-01-23 16:57:33 · 81 阅读 · 0 评论 -
第123场周赛
方法一:逐位相加思路让我们逐位将数字加在一起。举一个例子,如果要计算 123 与 912 的和。我们顺次计算 3+2、2+1、1+9。任何时候,当加法的结果大于等于 10 ,我们要将进位的 1 加入下一位的计算中去,所以最终结果等于 1035。算法我们可以对以上的想法做一个小变化,让它实现起来更容易 —— 我们将整个加数加入数组表示的数的最低位。继续之前的例子 123+912,我们把它表示成 [1, 2, 3+912]。然后,我们计算 3+912 = 915。5 留在当前这一位,将 910/10=转载 2019-02-13 23:54:14 · 145 阅读 · 0 评论