码迷,mamicode.com
首页 >  
搜索关键字:solution upgrade    ( 13024个结果)
441. 排列硬币
class Solution(object): def arrangeCoins(self, n): """ :type n: int :rtype: int """ return int(2 ** 0.5 * (n + 1 / 8) ** 0.5 - 1 / 2) if __name__ == ' ...
分类:其他好文   时间:2020-06-08 14:38:44    阅读次数:59
34. 在排序数组中查找元素的第一个和最后一个位置
class Solution(object): def searchRange(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ # 处理target不在nums中的情况 if ...
分类:编程语言   时间:2020-06-08 14:37:23    阅读次数:54
475. 供暖器
class Solution(object): def findRadius(self, houses, heaters): """ :type houses: List[int] :type heaters: List[int] :rtype: int """ ans = [] heaters.s ...
分类:其他好文   时间:2020-06-08 14:25:21    阅读次数:49
6.8每日一题题解
#解方程 题目链接:https://ac.nowcoder.com/acm/problem/14416 ###涉及知识点: 思维/二分 ###solution: 首先暴力枚举a,b 然后二分找到一个c的值使$ax^{2}+bx=-c$ 时间复杂度O(n^2logn) ###std: #include ...
分类:其他好文   时间:2020-06-08 14:19:57    阅读次数:50
287. 寻找重复数
题意:即nums长为n+1,里面的元素值范围:[1,n],有且仅有一个重复值,但该值可以重复多次,所以[1,n]有的数可以不在nums里。 方法一:二分查找。 class Solution(object): # 二分查找 def findDuplicate(self, nums): low = 1 ...
分类:其他好文   时间:2020-06-08 14:17:49    阅读次数:49
LeetCode---回溯法(全排列)
#46 全排列 https://leetcode-cn.com/problems/permutations/submissions/ 给定一个 没有重复 数字的序列,返回其所有可能的全排列。 class Solution { public: vector<vector<int>> result; v ...
分类:其他好文   时间:2020-06-08 13:05:47    阅读次数:64
LeetCode---排序
#853 车队 https://leetcode-cn.com/problems/car-fleet/ 这题我并没有使用某个排序算法,只是使用了Vector的可自定义sort方法。 class Solution { public: struct Car { int pos; int speed; f ...
分类:编程语言   时间:2020-06-08 12:46:31    阅读次数:48
第7次系统综合实践 26组
##1、在树莓派中安装opencv库 ###(1)安装依赖 sudo apt-get update && sudo apt-get upgrade sudo apt-get install build-essential cmake pkg-config sudo apt-get install l ...
分类:其他好文   时间:2020-06-08 10:37:41    阅读次数:72
Flutter upgrade更新版本引发的无法启动调试APP的错误 target:kernel_snapshot failed”
Flutter upgrade更新版本引发的无法启动调试APP的错误target:kernel_snapshot failed” ...
分类:移动开发   时间:2020-06-07 21:42:06    阅读次数:395
leetcode 每日一题 63. 不同路径 II
动态规划 思路: 参考62. 不同路径 代码: class Solution: def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int: m = len(obstacleGrid) n = len(obstac ...
分类:其他好文   时间:2020-06-07 15:05:47    阅读次数:65
共13024条   上一页 1 ... 94 95 96 97 98 ... 1303 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!