问题描述: 一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为“Start” )。 机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为“Finish”)。 问总共有多少条不同的路径? 例如,上图是一个7 x 3 的网格。有多少可能的路径?LeetCode ...
分类:
其他好文 时间:
2020-02-18 09:20:47
阅读次数:
59
网址:https://codeforces.com/problemset/problem/786/B 题意: 给出$n$个城市和三种路径:$u$向$v$连一条带权无向边;$[l,r]$向$v$连一条带权无向边;$u$向$[l,r]$连一条带权无向边,给出一个起点$s$,求它到其他点的最短路径,如果不 ...
分类:
其他好文 时间:
2020-02-17 23:44:48
阅读次数:
71
链接: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
原题链接在这里: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
原题链接在这里: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
题目描述 :给定一个正整数 n,将其拆分为至少两个正整数的和,并使这些整数的乘积最大化。 返回你可以获得的最大乘积。 题目分析 题目中“n 至少可以拆分为两个正整数的和”,这个条件说明了 n 是大于 1 的整数。 对 7 来说,可以拆成 3+4,最大乘积是 12。 对 8 来说,可以拆成 3+3+2 ...
分类:
编程语言 时间:
2020-02-17 00:40:33
阅读次数:
59
345. Reverse Vowels of a String(反转字符串中的元音字母) 链接 https://leetcode cn.com/problems/reverse vowels of a string 题目 编写一个函数,以字符串作为输入,反转该字符串中的元音字母。 示例 1: 输入: ...
分类:
其他好文 时间:
2020-02-16 14:31:59
阅读次数:
58
[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
题目地址 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
链接: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