码迷,mamicode.com
首页 >  
搜索关键字:integer game    ( 20395个结果
CF1434E. A Convex Game
题目描述 题解 虽然不会做,但是感觉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
HTML5 GAME TUTORIAL(六): Collision detection and physics(译)
原文地址:Collision detection and physics 使用JavaScript执行碰撞检测并产生物理反应。检查图形之间是否重叠,应用Hitbox并计算新速度。通过物体的质量,重力和恢复力使其更自然。 在本教程结束时,您将在游戏中运行基本的物理模拟。 创建一些移动的对象 如果您已经 ...
分类:Web程序   时间:2020-10-30 12:26:20    阅读次数:29
228. Summary Ranges - Easy
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
LeetCode 128. 最长连续序列
当我按照官方的思路写出代码,提交后并未通过,查看错误,发现算法错误的将[2147483647,-2147483648]也视为连续的整数了,这是因为我没有考虑到int类型的边界。将代码稍加修改,即成功提交 //哈希表,建议看官方的题解,尤其是演示动画 class Solution { public i ...
分类:其他好文   时间:2020-10-29 10:20:41    阅读次数:23
LeetCode 217. 存在重复元素
//通过哈希表来查重 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
LeetCode 145. 二叉树的后序遍历
class Solution { public List<Integer> postorderTraversal(TreeNode root) { //一般解法,前序遍历后,翻转下结果集,注意下 与前序遍历的进栈顺序不一样 //(前序) 根左右 --> 变为 根右左 --> 翻转 左右根 (后续) ...
分类:其他好文   时间:2020-10-27 11:40:04    阅读次数:20
sqlite
数据库 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
mybatis配置文件中的<setting>标签的默认值
<configuration> <properties resource="db.properties"></properties> <settings> <!-- 控制全局缓存(二级缓存),默认 true--> <setting name="cacheEnabled" value="true"/> ...
分类:其他好文   时间:2020-10-26 10:37:47    阅读次数:29
20395条   上一页 1 ... 26 27 28 29 30 ... 2040 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!