首页
控制台
留言板
分类
时间轴
关于我
Login
Menu
首页
控制台
留言板
分类
时间轴
关于我
十七
Archives
2022 / 02
acwing902. 最短编辑距离
2022-02-20
acwing
#dp
acwing897. 最长公共子序列
2022-02-20
acwing
#dp
leetcode53. 最大子数组和
2022-02-19
acwing
#dp
#简单
分析用f[i]来表示数组中第i个位置的最大数组和,那么计算f[i]的时候就需要从f[i-1]转移过来,转移方程为f[i]=max(f[i-1]+nums[i],nums[i]),由于只与f[i]和f[i-1]有关,可以用pre来表示i-1,ans来表示i。class Solution {public
leetcode51. N 皇后
2022-02-19
leetcode
#dfs
#困难
class Solution { char g[10][10]; bool col[20],dg[20],udg[20]; vector<vector<string>> res;//保存答案 vector<string> str;//用于保
acwing896. 最长上升子序列 II
2022-02-19
acwing
#二分
acwing895. 最长上升子序列
2022-02-19
acwing
#dp
leetcode50. Pow(x, n)
2022-02-18
leetcode
#数学
#中等
分析使用快速幂做法class Solution {public: double myPow(double x, int n) { double ans=1.0; if(x==0)return 0.0; long b=n; if(b<
acwing875. 快速幂
2022-02-18
acwing
#数学
leetcode49. 字母异位词分组
2022-02-18
leetcode
#字符串
#中等
#哈希
分析string排序后的值相同的,可以使用字符串哈希将对应的字符串加进vector中,最后遍历哈希表,得到答案class Solution {public: vector<vector<string>> groupAnagrams(vector<string>
acwing898. 数字三角形
2022-02-18
acwing
#dp
Previous
34 / 43
Next