转自:labuladong公众号 很多读者反应,就算看了前文 动态规划详解,了解了动态规划的套路,也不会写状态转移方程,没有思路,怎么办?本文就借助「最长递增子序列」来讲一种设计动态规划的通用技巧:数学归纳思想。 最长递增子序列(Longest Increasing Subsequence,简写 L ...
分类:
编程语言 时间:
2020-03-05 01:00:26
阅读次数:
71
查看数据库表信息 查询语句 DISTINCT 检索出不同值的列 LIMIT 限制返回的行数 排序检索 使用ORDER BY 和LIMIT 可以找出列中最高或最低的值 SELECT COLUMN1 FROM TABLE1 ORDER BY COLUMN1 LIMIT 1; 过滤数据 WHERE搜索条件 ...
分类:
数据库 时间:
2020-03-02 14:25:16
阅读次数:
80
操作表内容 注册一个表 增删改 查看表中内容 显示模式 查表顺序 where 初级筛选 group by分组 与聚合 having对组过滤 distinct 去重 order by 排序 limit 取一个区间 查询步骤 ...
分类:
其他好文 时间:
2020-03-01 10:56:56
阅读次数:
77
新建一个list: List<string> info1= new List<string>(); 赋值: info1.Add("1"); info1.Add("1"); info1.Add("2"); info1.Add("1"); info1.Add("3"); info1.Add("4"); ...
A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Wri ...
分类:
其他好文 时间:
2020-02-29 11:42:15
阅读次数:
107
最多有K个不同字符的最长子串。题意就不解释了,参见159题。例子, Example 1: Input: s = "eceba", k = 2 Output: 3 Explanation: T is "ece" which its length is 3. Example 2: Input: s = ...
分类:
其他好文 时间:
2020-02-28 15:37:15
阅读次数:
51
最多有两个不同字符的最长子串。题意是给一个字符串,请返回一个最长子串的长度。子串的要求是最多只有两个不同的字母。例子, Example 1: Input: "eceba" Output: 3 Explanation: tis "ece" which its length is 3. Example ...
分类:
其他好文 时间:
2020-02-28 13:52:03
阅读次数:
68
output standard output You are given an array aa of length nn . You are also given a set of distinct positions p1,p2,…,pmp1,p2,…,pm , where 1≤pi<n1≤pi ...
分类:
编程语言 时间:
2020-02-27 19:25:01
阅读次数:
259
1 """ 2 Given a set of distinct integers, nums, return all possible subsets (the power set). 3 Note: The solution set must not contain duplicate subse ...
分类:
其他好文 时间:
2020-02-27 00:43:40
阅读次数:
73
代码: #include<iostream> #include<stdio.h> using namespace std; const int maxn = 1001; int a[maxn],dp[maxn]; int main(){ int n; cin>>n; for(int i=1;i<=n ...
分类:
其他好文 时间:
2020-02-26 18:32:51
阅读次数:
54