会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
行者常至,为者长成
导航
博客园
首页
新随笔
联系
订阅
管理
公告
上一页
1
2
3
4
下一页
2020年6月19日
双指针法
摘要: 1、盛水最多的容器 2、三数之和 3、四数之和
阅读全文
posted @ 2020-06-19 15:28 行者常至,为者长成
阅读(173)
评论(0)
推荐(0)
2020年6月5日
并查集
摘要: 1、交换字符串中的元素: https://leetcode-cn.com/problems/smallest-string-with-swaps/solution/bing-cha-ji-by-liyiping/ 并查集详解见博客:https://blog.csdn.net/qq_41593380/
阅读全文
posted @ 2020-06-05 00:11 行者常至,为者长成
阅读(67)
评论(0)
推荐(0)
2020年3月30日
c++常用函数
摘要: 一、sort函数 在sort函数中使用 greater<>() 和 less<int>()int A[]={1,4,3,7,10};const int N=sizeof(A)/sizeof(int);vector<int>vec(A, A+N); sort(vec.begin(),vec.end()
阅读全文
posted @ 2020-03-30 21:27 行者常至,为者长成
阅读(695)
评论(0)
推荐(0)
2020年3月29日
vector常用方法
摘要: 1、find使用 不同于map(map有find方法),vector本身是没有find这一方法,其find是依靠algorithm来实现的。 #include <iostream>#include <algorithm>#include <vector> int main(){ using name
阅读全文
posted @ 2020-03-29 11:44 行者常至,为者长成
阅读(421)
评论(0)
推荐(0)
2020年3月22日
贪心算法
摘要: 1、常见贪心算法题目 中等:55. 跳跃游戏https://leetcode-cn.com/problems/jump-game/134. 加油站https://leetcode-cn.com/problems/gas-station/ 困难:45. 跳跃游戏 IIhttps://leetcode-
阅读全文
posted @ 2020-03-22 11:44 行者常至,为者长成
阅读(135)
评论(0)
推荐(0)
字符串类问题
摘要: 1、若题目中明确说明只包含字母,可以考虑哈希表 LeetCode常见题型: 1、字符串的排列https://leetcode-cn.com/problems/permutation-in-string/ 2、 拼写单词https://leetcode-cn.com/problems/find-wor
阅读全文
posted @ 2020-03-22 11:42 行者常至,为者长成
阅读(84)
评论(0)
推荐(0)
编程中常遇到的细节问题
摘要: 1、输入输出#include<iostream>using namespace std;int n;cin>>n;cout<< n<<endl; 字符串注意:cin提取始终将空格(空格,制表符,换行符...)视为终止要提取的值,因此提取字符串意味着始终提取单个单词,而不是短语或整个句子。cin>>s
阅读全文
posted @ 2020-03-22 11:40 行者常至,为者长成
阅读(220)
评论(0)
推荐(0)
2020年3月20日
动态规划总结
摘要: 动态规划三部曲 1)定义数组元素含义 2)寻找递推关系 dp 3)找初始值 参考博客:https://zhuanlan.zhihu.com/p/91582909 解题步骤: 1、确定需要保存在dp表中的状态。(关键:确定影响状态的维度和每个元素代表的含义) 一维:dp[n]=f(dp[n-1]) 二
阅读全文
posted @ 2020-03-20 21:49 行者常至,为者长成
阅读(142)
评论(0)
推荐(0)
linux下gdb调试方法与技巧整理
摘要: 参考博客: https://blog.csdn.net/niyaozuozuihao/article/details/91802994 1、运行命令run:简记为 r ,其作用是运行程序,当遇到断点后,程序会在断点处停止运行,等待用户输入下一步的命令。continue (简写c ):继续执行,到下一
阅读全文
posted @ 2020-03-20 21:48 行者常至,为者长成
阅读(769)
评论(0)
推荐(0)
未分类——数组
摘要: 554. 砖墙https://leetcode-cn.com/problems/brick-wall/939. 最小面积矩形https://leetcode-cn.com/problems/minimum-area-rectangle/ 73. 矩阵置零https://leetcode-cn.com
阅读全文
posted @ 2020-03-20 21:46 行者常至,为者长成
阅读(107)
评论(0)
推荐(0)
上一页
1
2
3
4
下一页