码迷,mamicode.com
首页 >  
搜索关键字:solution upgrade    ( 13024个结果)
leetcode62 不同路径(Medium)
题目来源:leetcode62 不同路径 题目描述: 一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为“Start” )。 机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为“Finish”)。 问总共有多少条不同的路径? 示例 1: 输入: m = ...
分类:其他好文   时间:2020-07-17 13:59:00    阅读次数:52
configure 错误
./configure: line 16651: syntax error near unexpected token 0.20' ./configure: line 16651: PKG_PROG_PKG_CONFIG(0.20)' solution: pkg-config --version s ...
分类:其他好文   时间:2020-07-17 01:13:07    阅读次数:88
785. 判断二分图
利用二分图没有奇环的性质 DFS: class Solution { private: static constexpr int UNCOLORED = 0; static constexpr int RED = 1; static constexpr int GREEN = 2; vector<i ...
分类:其他好文   时间:2020-07-16 21:49:52    阅读次数:71
LuoguP4279 [SHOI2008]小约翰的游戏
LuoguP4279 [SHOI2008]小约翰的游戏 题目描述 链接 Solution Anti-SG的模板题 这里就直接放代码 #include<bits/stdc++.h> using namespace std; inline long long read() { long long f = ...
分类:其他好文   时间:2020-07-16 21:44:29    阅读次数:72
判断二分图
思路染色问题,可以使用dfs,也可以使用bfs代码class Solution { boolean valid = true; int[][] graph; public boolean isBipartite(int[][] graph) { this.graph = graph; int n =... ...
分类:其他好文   时间:2020-07-16 21:42:04    阅读次数:58
【算法】【高精度】大数相关问题总结
常考 大数乘法 题目链接:https://leetcode-cn.com/problems/multiply-strings/ class Solution { public: string multiply(string num1, string num2) { string res(num1.s ...
分类:编程语言   时间:2020-07-16 12:20:14    阅读次数:64
leetcode-----90. 子集 II
链接:https://leetcode-cn.com/problems/subsets-ii/ 代码 class Solution { public: vector<vector<int>> ans; vector<int> path; vector<vector<int>> subsetsWith ...
分类:其他好文   时间:2020-07-16 00:27:10    阅读次数:75
【leetcode_easy_array】1394. Find Lucky Integer in an Array
problem 1394. Find Lucky Integer in an Array solution #1: 使用哈希表; 使用哈希表记录数组元素和freq,然后判断是否相等,且取最大值; 注意 1. 最大值可以由下标一次递减隐性表示; 2. 数值的范围是1-500; 参考 1. leetco ...
分类:其他好文   时间:2020-07-16 00:22:19    阅读次数:51
621. 任务调度器
给定一个用字符数组表示的 CPU 需要执行的任务列表。其中包含使用大写的 A - Z 字母表示的26 种不同种类的任务。任务可以以任意顺序执行,并且每个任务都可以在 1 个单位时间内执行完。CPU 在任何一个单位时间内都可以执行一个任务,或者在待命状态。 然而,两个相同种类的任务之间必须有长度为 n ...
分类:其他好文   时间:2020-07-16 00:13:43    阅读次数:73
96不同的二查搜索树
# 二叉搜索树的特点是左子树小于根节点,右子树大于根节点。# 因此当根节点为i的时候,左子树的值为1:i-1,右子树为i+1:n# 当节点为n的时候所有的能够组成的树为左子树个数乘以右子树个数。class Solution: def numTrees(self, n: int) -> int: dp ...
分类:其他好文   时间:2020-07-15 23:51:44    阅读次数:62
共13024条   上一页 1 ... 64 65 66 67 68 ... 1303 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!