题目描述 题解 虽然不会做,但是感觉3500还是高了 首先在博弈问题中,如果一个状态的sg=i,那么一定存在一条从该状态出发的长度为i的链 设f[i,j]表示以i结尾,最后差为j的sg,则显然sg不超过√2maxc 所以直接dp存sg,设f[i,j]表示以i结尾,sg为j的最大差,显然随着差的不断减 ...
分类:
其他好文 时间:
2020-10-30 12:34:47
阅读次数:
18
原文地址:Collision detection and physics 使用JavaScript执行碰撞检测并产生物理反应。检查图形之间是否重叠,应用Hitbox并计算新速度。通过物体的质量,重力和恢复力使其更自然。 在本教程结束时,您将在游戏中运行基本的物理模拟。 创建一些移动的对象 如果您已经 ...
分类:
Web程序 时间:
2020-10-30 12:26:20
阅读次数:
29
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
<configuration> <properties resource="db.properties"></properties> <settings> <!-- 控制全局缓存(二级缓存),默认 true--> <setting name="cacheEnabled" value="true"/> ...
分类:
其他好文 时间:
2020-10-26 10:37:47
阅读次数:
29