状态转移方程的定义为:dp( K,i ) 表示经历 K 站乘坐到 flight[i] 航班终点的最低票价。 因为 flight 中的元素存在前后置关系,所以乘坐某航班的上一航班的集合是可以确定的。 dp( K,i ) = Math.min( dp( K-1,j ) ),其中 j 为可以作为上一趟航班 ...
分类:
其他好文 时间:
2020-11-01 10:08:43
阅读次数:
15
实例 指定段落的字体: p{font-family:"Times New Roman",Georgia,Serif;} 尝试一下 » 属性定义及使用说明 font - family属性指定一个元素的字体。 font-family 可以把多个字体名称作为一个"回退"系统来保存。如果浏览器不支持第一个字 ...
分类:
Web程序 时间:
2020-10-31 01:44:00
阅读次数:
30
* Created by cws */ @Data public class ResultVM implements Serializable { private static final long serialVersionUID = 1L; public static final Integer ...
分类:
其他好文 时间:
2020-10-31 01:21:33
阅读次数:
20
You are given a sorted unique integer array nums. Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, ...
分类:
其他好文 时间:
2020-10-30 11:55:20
阅读次数:
20
当我按照官方的思路写出代码,提交后并未通过,查看错误,发现算法错误的将[2147483647,-2147483648]也视为连续的整数了,这是因为我没有考虑到int类型的边界。将代码稍加修改,即成功提交 //哈希表,建议看官方的题解,尤其是演示动画 class Solution { public i ...
分类:
其他好文 时间:
2020-10-29 10:20:41
阅读次数:
23
//通过哈希表来查重 class Solution { public boolean containsDuplicate(int[] nums) { Set<Integer> set = new HashSet<>(); for(int i = 0;i < nums.length;i++){ if( ...
分类:
其他好文 时间:
2020-10-29 10:06:06
阅读次数:
17
class Solution { public List<Integer> postorderTraversal(TreeNode root) { //一般解法,前序遍历后,翻转下结果集,注意下 与前序遍历的进栈顺序不一样 //(前序) 根左右 --> 变为 根右左 --> 翻转 左右根 (后续) ...
分类:
其他好文 时间:
2020-10-27 11:40:04
阅读次数:
20
数据库 con.Execute(string.Format(@"CREATE TABLE Category ( Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, Name VARCHAR (50) NOT NULL, Pid INTEGER, Creati ...
分类:
数据库 时间:
2020-10-27 10:51:41
阅读次数:
31
1. 深度优先遍历 使用场景:常见于各种组合,树遍历,前序遍历、中序遍历、后续遍历 private void dfs(int[] arr, int target,int begin, Deque<Integer> path, Set<List<Integer>> res) { if ( path.s ...
分类:
编程语言 时间:
2020-10-26 10:56:27
阅读次数:
26
以ArrayList为例。 List<Integer> list = new ArrayList<>(); for(int i=0;i<11;i++){ List.add(i);} 遍历方式一:普通for循环(适合ArrayList。) for(int i=0;i<list.size();i++){ ...
分类:
其他好文 时间:
2020-10-26 10:41:31
阅读次数:
24