码迷,mamicode.com
首页 >  
搜索关键字:problems    ( 6275个结果
LeetCode.62——不同路径
问题描述: 一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为“Start” )。 机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为“Finish”)。 问总共有多少条不同的路径? 例如,上图是一个7 x 3 的网格。有多少可能的路径?LeetCode ...
分类:其他好文   时间:2020-02-18 09:20:47    阅读次数:59
codeforces786B Legacy 线段树优化建图
网址:https://codeforces.com/problemset/problem/786/B 题意: 给出$n$个城市和三种路径:$u$向$v$连一条带权无向边;$[l,r]$向$v$连一条带权无向边;$u$向$[l,r]$连一条带权无向边,给出一个起点$s$,求它到其他点的最短路径,如果不 ...
分类:其他好文   时间:2020-02-17 23:44:48    阅读次数:71
剑指OFFER----面试题10- II. 青蛙跳台阶问题
链接:https://leetcode-cn.com/problems/qing-wa-tiao-tai-jie-wen-ti-lcof/ 代码: class Solution { public: int numWays(int n) { std::vector<int> vec = {1, 1}; ...
分类:其他好文   时间:2020-02-17 17:52:45    阅读次数:49
LeetCode 1029. Two City Scheduling
原题链接在这里:https://leetcode.com/problems/two-city-scheduling/ 题目: There are 2N people a company is planning to interview. The cost of flying the i-th per ...
分类:其他好文   时间:2020-02-17 13:58:18    阅读次数:70
LeetCode 1169. Invalid Transactions
原题链接在这里:https://leetcode.com/problems/invalid-transactions/ 题目: A transaction is possibly invalid if: the amount exceeds $1000, or; if it occurs withi ...
分类:其他好文   时间:2020-02-17 13:57:48    阅读次数:84
LeetCode 343.整数拆分 - JavaScript
题目描述 :给定一个正整数 n,将其拆分为至少两个正整数的和,并使这些整数的乘积最大化。 返回你可以获得的最大乘积。 题目分析 题目中“n 至少可以拆分为两个正整数的和”,这个条件说明了 n 是大于 1 的整数。 对 7 来说,可以拆成 3+4,最大乘积是 12。 对 8 来说,可以拆成 3+3+2 ...
分类:编程语言   时间:2020-02-17 00:40:33    阅读次数:59
LeetCode 345. Reverse Vowels of a String
345. Reverse Vowels of a String(反转字符串中的元音字母) 链接 https://leetcode cn.com/problems/reverse vowels of a string 题目 编写一个函数,以字符串作为输入,反转该字符串中的元音字母。 示例 1: 输入: ...
分类:其他好文   时间:2020-02-16 14:31:59    阅读次数:58
leetcode 0216
[toc] ? 893. 特殊等价字符串组 https://leetcode cn.com/problems/groups of special equivalent strings 描述 ? 811. 子域名访问计数 https://leetcode cn.com/problems/subdoma ...
分类:其他好文   时间:2020-02-16 12:49:09    阅读次数:92
【Leetcode】322. coin-change
题目地址 https://leetcode.com/problems/coin change 题目大意 https://leetcode cn.com/problems/coin change 解题思路 动态规划,自底向上,太简单,不解释。 C++代码 复杂度 1. 时间复杂度:O(m n), m是 ...
分类:其他好文   时间:2020-02-16 01:39:10    阅读次数:73
剑指OFFER----面试题05.替换空格
链接:https://leetcode-cn.com/problems/ti-huan-kong-ge-lcof/ 代码: class Solution { public: string replaceSpace(string s) { string res; for (auto x: s) { i ...
分类:其他好文   时间:2020-02-15 18:41:16    阅读次数:57
6275条   上一页 1 ... 96 97 98 99 100 ... 628 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!