228. 汇总区间 分类: 数组 简单题,但是边界条件挺细节,特别是c++,还要额外注意int的边界,不然 nums[i] == nums[i-1] + 1会overflow class Solution { public: vector<string> summaryRanges(vector<i ...
分类:
其他好文 时间:
2021-01-12 11:07:54
阅读次数:
0
题意 对图片先水平翻转再反转图片 水平翻转:就是改为逆序,比如[1,0,0]->[0,0,1] 反转图片:0->1, 1->0 思路 完全按照题目中所说的进行模拟 对于水平翻转:可以用reverse() 对于反转图片,可用 1??^=1,因为一个数和自己异或是0,0和1异或刚好是1 2??=abs( ...
分类:
其他好文 时间:
2021-01-12 10:57:29
阅读次数:
0
Win10 x64 安装 ArcGIS 10.8,运行Setup.exe时,总是报错需要 Microsoft Visual C++ 2015-2019 Redist 14.22.27821或更高版本 从 Microsoft 官网下载:https://support.microsoft.com/en- ...
分类:
编程语言 时间:
2021-01-11 11:19:19
阅读次数:
0
#include <iostream> #include <vector> #include <string> using namespace std; struct Node { int data; Node * next; }; Node * reverseList(Node * head) { ...
分类:
其他好文 时间:
2021-01-11 11:11:15
阅读次数:
0
一步一步推导出官方最优解法,详细图解 上面这篇文章讲的很详细了。 ####300. 最长递增子序列 class Solution { public: int lengthOfLIS(vector<int>& nums) { vector<int> minList; for(auto& i : num ...
分类:
其他好文 时间:
2021-01-06 12:12:27
阅读次数:
0
1.返回值 vector为向量,返回行或列的最大值的索引号; vector为矩阵,返回值是向量,返回每行或每列的最大值的索引号。 2.参数 vector为向量或者矩阵 axis = 0 或1 0:返回vector中每列的最大值的索引号 1:返回vector中每行的最大索引号 3.例子 import ...
分类:
其他好文 时间:
2021-01-06 11:56:49
阅读次数:
0
描述现象 用pyinstaller打包了一个上传文件的脚本,里面有多个input在while循环内,然后启用了多线程上传,在编辑器中运行没问题,但是打包完后,就一直循环提示你input... 解决 在google了一段时间后,发现需要在执行入口之前调用 multiprocessing.freeze_ ...
分类:
编程语言 时间:
2021-01-06 11:56:17
阅读次数:
0
#include<iostream> #include<vector> using namespace std; vector<char>post,in; vector<char>level(100000,-1); in N; void ergodic(int root,int start,int ...
分类:
编程语言 时间:
2021-01-05 11:40:19
阅读次数:
0
Arraylist和Vector是采用数组方式存储数据,此数组元素数大于实际存储的数据以便增加插入元素,都允许直接序号索引元素,但是插入数据要涉及到数组元素移动等内存操作,所以插入数据慢,查找有下标,所以查询数据快,Vector由于使用了synchronized方法-线程安全,所以性能上比Array ...
分类:
其他好文 时间:
2021-01-05 11:34:42
阅读次数:
0
问题: 给定一个计量括号数量的数字n,求所有的括号组合可能序列。 Example 1: Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"] Example 2: Input: n = 1 Output: ["()"] ...
分类:
其他好文 时间:
2021-01-05 11:32:45
阅读次数:
0