码迷,mamicode.com
首页 >  
搜索关键字:jump game ii    ( 12386个结果
[LC] 55. Jump Game
Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim ...
分类:其他好文   时间:2019-12-16 13:29:17    阅读次数:92
用原生js写小游戏--Flappy Bird
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> body { margin: 0; padding: 0; } #game { width: ...
分类:移动开发   时间:2019-12-16 10:05:29    阅读次数:108
【LeetCode刷题】NIM游戏:妙解
巴什博奕,n%(m+1)!=0时,先手总是会赢的 来自 <https://leetcode-cn.com/problems/nim-game/comments/> 思路:此题代码很简单,但是思想却不好理解,我们每次拿石头,一共有两种情况,A:石头总数为4的倍数,B:石头总数不为4的倍数,为什么我们会 ...
分类:其他好文   时间:2019-12-16 09:23:17    阅读次数:88
leetcode 40. Combination Sum II
与上一题差不多。但结果不能重复,我们可以做一个去重处理 javascript var combinationSum2 = function (nums, target) { if (!Object(nums).length) { return []; } nums.sort() var uniq = ...
分类:其他好文   时间:2019-12-15 18:14:11    阅读次数:92
fjnu2019第二次友谊赛 B题
### 题目链接 ### 题目大意: 给你一个 n * m 的地图以及小蛇蛇头的初始位置,告诉你它会往 上、下、左、右 四个方向走。若在走的过程中(包括结束时)会使得小蛇越界,则输出 "Game Over!" ,否则输出 "Alice!" 以及蛇头最后的坐标位置。 分析: 简单模拟题,只需模拟小蛇蛇 ...
分类:其他好文   时间:2019-12-15 16:12:45    阅读次数:60
动规基础——01背包问题(背包问题Ⅱ)
题目来源: "领扣 | LintCode" 有 i 个物品和一个总容量为 j 的背包. 给定数组 weight 表示每个物品的重量和数组 value 表示每个物品的价值,求最大价值。(物品不能分割) 背包问题II 这道题是一道动态规划(dp)算法的基础题,有两种实现方式,分别是递归和递推(迭代),前 ...
分类:其他好文   时间:2019-12-15 12:28:45    阅读次数:83
Asia Hong Kong Regional Contest 2019
A. Axis of Symmetry B. Binary Tree n 的奇偶性决定胜负。 C. Constructing Ranches 路径上点权之和大于,极大值两倍,这是路径上点能拼出多边形的充要条件。 树分治,进行路径统计即可。 有请 F0_0H 讲解下怎样卡常。 D. Defining ...
分类:其他好文   时间:2019-12-15 10:53:50    阅读次数:289
【leetcode】1289. Minimum Falling Path Sum II
题目如下: Given a square grid of integers arr, a falling path with non-zero shifts is a choice of exactly one element from each row of arr, such that no t ...
分类:其他好文   时间:2019-12-15 10:26:34    阅读次数:108
D - A Game with Traps-- codeforces 1260D A
题目大意: 一共有m个士兵,k个陷阱,时间为t,一个首领,这个首领需要在t时间内尽可能多的将士兵带到boos的面前, 第二行是每个士兵的灵敏度。 紧接着是k个陷阱,每个陷阱有l,,r,,d组成,l代表陷阱的位置,r代表l处的陷阱可以在位置r处被解决,陷阱的灵敏度是d,当陷阱的灵敏度比士兵的灵敏度大时 ...
分类:其他好文   时间:2019-12-15 01:26:25    阅读次数:140
LeetCode 5129. 下降路径最小和 II Minimum Falling Path Sum II
地址 https://leetcode-cn.com/contest/biweekly-contest-15/problems/minimum-falling-path-sum-ii/ 题目描述给你一个整数方阵 arr ,定义「非零偏移下降路径」为:从 arr 数组中的每一行选择一个数字,且按顺序选 ...
分类:其他好文   时间:2019-12-15 01:00:24    阅读次数:74
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!