码迷,mamicode.com
首页 >  
搜索关键字:solution upgrade    ( 13024个结果)
剑指42 连续字数租的最大和
输入一个整型数组,数组里有正数也有负数。数组中的一个或连续多个整数组成一个子数组。求所有子数组的和的最大值。 要求时间复杂度为O(n)。 很简单的一道题, 但是犯了不少错误,主要在于ret和curmax的初值。每一步都要和ret比较一下。 1 class Solution { 2 public: 3 ...
分类:其他好文   时间:2020-07-18 11:26:32    阅读次数:59
leetcode-----96. 不同的二叉搜索树
链接:https://leetcode-cn.com/problems/unique-binary-search-trees/ 代码 class Solution { public: int numTrees(int n) { vector<int> f(n + 1); f[0] = 1; for ...
分类:其他好文   时间:2020-07-18 11:25:21    阅读次数:56
leetcode-----97. 交错字符串
链接:https://leetcode-cn.com/problems/interleaving-string/ 代码 class Solution { public: bool isInterleave(string s1, string s2, string s3) { int n = s1.s ...
分类:其他好文   时间:2020-07-18 11:21:07    阅读次数:43
2020.7.17 力扣每日
1 class Solution { 2 public int searchInsert(int[] nums, int target) { 3 int length = nums.length; 4 int left = 0, right = length - 1, ans = 0; 5 whil ...
分类:其他好文   时间:2020-07-18 00:57:17    阅读次数:92
LeetCode87. 扰乱字符串
判断S2是否是S1的扰乱字符串。根据题目的定义,S1如果经过若干次对于部分子串的翻转操作能够得到S2,则S2是S1的扰乱字符串。 首先,如果S2是S1的扰乱字符串,那么S1中每个字符的出现次数必然和S2中每个字符的出现次数一致,也就是说,我们用两个字符串S3、S4备份一下S1和S2, 对S3和S4排 ...
分类:其他好文   时间:2020-07-18 00:42:29    阅读次数:62
搜索插入位置
思路 二分查找,注意如果target不在数组中时,需要判断一下下标 代码 class Solution { public int searchInsert(int[] nums, int target) { //二分查找 int left = 0; int right = nums.length - ...
分类:其他好文   时间:2020-07-18 00:42:00    阅读次数:64
Milestone 不能卸载,修复 Counter 即可
XProtect installer may fail with the error "Category does not exist" or "Cannot load Counter Name data because an invalid index" When running the XPro ...
分类:其他好文   时间:2020-07-17 19:49:17    阅读次数:124
[组合数学][CF1188E]Problem from Red Panda
题目链接 题目传送门 简要题意 有一个长度为 \(k\) 的数组 \(a\),每次可以选择一个 $1\le i\le k$,让 \(a_i\) 加上 \(k-1\),并对于所有的 \(j\ne i\) 让 \(a_j\) 减掉 $1$,任何时候必须保证 \(a\) 数组非负。 求通过任意多次(可以为 ...
分类:其他好文   时间:2020-07-17 19:47:56    阅读次数:80
[经验栈]Typecho升级(upgrade)失败Database Query Error
1前言 昨天武小栈把typecho从正式版升级到开发版就遇到了Database Query Error错误,详情是SQLSTATE[HY000]: General error: 1 no such table: typecho_metas,经过查看数据库后发现是升级的时候metas表被程序删掉了,顺 ...
分类:数据库   时间:2020-07-17 16:01:49    阅读次数:92
leetcode-785-判断二分图
题目描述: 第一次提交:通过76/78 留坑 class Solution: def isBipartite(self, graph: List[List[int]]) -> bool: dic = {} l = [] for i in range(len(graph)): if graph[i] ...
分类:其他好文   时间:2020-07-17 14:14:05    阅读次数:61
共13024条   上一页 1 ... 63 64 65 66 67 ... 1303 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!