码迷,mamicode.com
首页 >  
搜索关键字:jump game ii    ( 12386个结果
[LeetCode] 940. Distinct Subsequences II
Given a string S, count the number of distinct, non-empty subsequences of S . Since the result may be large, return the answer modulo 10^9 + 7. Exampl ...
分类:其他好文   时间:2020-03-18 09:38:23    阅读次数:52
面试题59 - II.:队列的最大值(C++)
题目地址:https://leetcode-cn.com/problems/dui-lie-de-zui-da-zhi-lcof/ 题目描述 请定义一个队列并实现函数 max_value 得到队列里的最大值,要求函数max_value、push_back 和 pop_front 的均摊时间复杂度都是 ...
分类:编程语言   时间:2020-03-18 09:18:46    阅读次数:69
40. 组合总和 II
1 class Solution 2 { 3 vector<vector<int>> res; 4 int sum = 0; 5 public: 6 void helper(vector<int>& nums, int start,int target, vector<int>& out) 7 { ...
分类:其他好文   时间:2020-03-17 23:55:47    阅读次数:93
LeetCode——best-time-to-buy-and-sell-stock i-ii-iii
Q:假设你有一个数组,其中第i个元素是某只股票在第i天的价格。 如果你最多只能完成一笔交易(即买一股和卖一股股票),设计一个算法来求最大利润。 A:当前值比最小值小,代替最小值;当前值比最小值大,计算差值,和之前的差值做判断。 Q:假设你有一个数组,其中第i个元素表示某只股票在第i天的价格。 设计一 ...
分类:其他好文   时间:2020-03-15 22:02:24    阅读次数:46
Gym102431G Game on the Tree
结论:后手必胜当且仅当根节点为直径中点。 根节点为直径中点: 如果两人都在直径上移动,那么不论先手如何移动,后手总能移动到对称的位置。 如果先手移出了直径,设这一点与根节点的距离为$x$,那么后手仍然回到直径上距离根节点$x$的点。 其它的情况先手只需移动至直径中点(当直径中点在边上时移动至该边的一 ...
分类:其他好文   时间:2020-03-15 16:27:10    阅读次数:65
Blocked Billboard II
前言 比赛真的状态不好(腐了一小会),导致差点爆0。 这个题解真的是在非常非常专注下写出来的,要不然真的心态崩。 题目 题目描述 奶牛Bassie想要覆盖一大块广告牌,她在之前已经覆盖了一小部分广告牌(但覆盖的这块面积不一定在广告牌上) 现在她要取一块足够大的布来将剩下的部分覆盖,问至少要多大的矩形 ...
分类:其他好文   时间:2020-03-15 16:21:40    阅读次数:60
力扣LeetCode,两个数组的交集 II
1、给定两个数组,编写一个函数来计算它们的交集。 示例 1: 1 输入: nums1 = [1,2,2,1], nums2 = [2,2] 2 输出: [2,2] 示例 2: 1 输入: nums1 = [4,9,5], nums2 = [9,4,9,8,4] 2 输出: [4,9] 说明: 输出结 ...
分类:编程语言   时间:2020-03-15 13:23:58    阅读次数:41
python code practice: 快排、归并、堆排的实现,双指针/滑动窗口技术
基本原理就不做介绍了, 很基础的数据结构课程知识.私下回顾即可,主要学习代码. 1.双指针 https://leetcode-cn.com/problems/two-sum-ii-input-array-is-sorted/description/?utm_source=LCUS&utm_mediu ...
分类:编程语言   时间:2020-03-15 13:20:39    阅读次数:70
D - Pair of Topics
The next lecture in a high school requires two topics to be discussed. The ii-th topic is interesting by aiaiunits for the teacher and by bibi units f ...
分类:其他好文   时间:2020-03-14 23:59:09    阅读次数:158
A - Yet Another Tetris Problem
You are given some Tetris field consisting of nn columns. The initial height of the ii-th column of the field is aiai blocks. On top of these columns ...
分类:其他好文   时间:2020-03-14 23:53:35    阅读次数:75
12386条   上一页 1 ... 69 70 71 72 73 ... 1239 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!