自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(80)
  • 收藏
  • 关注

原创 anaconda虚拟环境无法import已安装的包问题

文章目录bug记录定位分析问题解决bug记录今天创建了一个新环境之后突然发现旧环境里的所有包都无法import了定位分析之前有一个已经启动的ssh窗口使用的是旧环境,在该窗口下尝试import发现成功。观察发现新旧两个环境指定的python大版本都为3.7,但旧环境具体为3.7.6,新版为3.7.7,结果安装新的虚拟环境后旧版的python也被替换成了3.7.7,而anaconda默认的所有包安装路径都是和python关联了,python被替换后就导致了之前安装的包找不到问题解决因为环境里装了

2020-09-18 15:34:42 4490 1

原创 华为2020软件精英挑战赛初赛、复赛、决赛代码+心得分享

Huawei-Code-Craft-2020写在前面初赛第一代思路第二代思路最终版思路优化思路多线程数据结构设计输入和输出的优化对内存、和数据访问的优化复赛规则描述优化思路算法多线程数据结构设计复赛正式赛总决赛总结写在前面2020华为软件精英挑战赛京津冀东北赛区“花样划水”队,初赛第4,复赛第2,决赛第23。 本来因为决赛成绩不理想,就不打算开源了,如今比赛已经过去将近一个月,最近有人跟我说想看看当时比赛的代码,找代码的时候发现对代码已经没啥印象了。 于是决定趁着对代码还有点印象,做一个整理并开源,

2020-06-22 16:16:49 2682 1

原创 对逻辑回归的一点理解

对逻辑回归的一点理解逻辑回归是什么回归和分类是什么意思如何利用已知样本做预测如何选择概率模型逻辑回归是什么我认为逻辑回归可以概括为一句话:用回归的方法解决分类的问题,即对要预测的分类结果的概率值作为回归的对象,当概率值超过我们设定的某个阈值的时候,就将其看作某个类别回归和分类是什么意思回归和分类都是给定输入预测输出的问题,回归预测连续值,分类预测离散值如何利用已知样本做预测通常采用极大...

2019-10-27 21:03:28 210

转载 对cuda内核的一点认识

cuda

2019-07-06 10:49:50 1068

转载 思维导图学习开坑

1.https://www.zhihu.com/search?type=content&q=思维导图

2019-07-05 17:35:51 158

转载 如何快速掌握一个大型项目的源代码

对我在网上找到的相关方面的优质文章做一个记录,方便有空时查阅。1.https://blog.csdn.net/iteye_2075/article/details/81763629

2019-07-05 17:29:22 1577

转载 零基础ORBSLAM2学习资料参考

ORB算法基于FAST角点检测算法和BRIEF描述子FAST角点检测算法1、首先应该了解角点(或特征点、关键点)是用来做什么的,我们如何定义和寻找它们,参考:https://blog.csdn.net/yizhang_ml/article/details/869941932、之后就可以开始学习FAST 算法,参考:https://blog.csdn.net/hujingshuang/ar...

2019-07-04 18:21:28 207

原创 对最小二乘法的一点理解 - slam学习笔记

我对最小二乘法的理解:在给定参数个数和函数模型之后,根据测试数据,找出与所有测试数据的偏差的平方和最小的参数。这里面应该有两个问题:1、为什么选取与真实数据平方和最小的拟合函数;2、如何求参数。为什么选取与真实数据平方和最小的拟合函数极大似然,详见https://blog.csdn.net/u011893609/article/details/80016915如何求参数代数法:...

2019-06-10 16:05:56 286

原创 leetcode - 394. Decode String

class Solution {public: string doit(int &i,string &s) { string s1; if(i>=s.size()) return s1; for(;i<s.size();++i) { if((s[...

2019-05-09 17:47:01 159

原创 leetcode - 338. Counting Bits

class Solution {public: vector<int> countBits(int num) { vector<int> ret(num+1,0); for(int i=1;i<=num;++i) { ret[i]=ret[i>>1]+i%2; ...

2019-05-09 16:46:56 106

原创 leetcode - 337. House Robber III

/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */cla...

2019-05-09 16:34:55 102

原创 leetcode - 213. House Robber II

class Solution {public: int rob(vector<int>& nums) { if(nums.empty()) return 0; if(nums.size()==1) return nums[0]; int arr[2]={}; int i(0),ret; ...

2019-05-08 00:06:18 114

原创 leetcode - 198. House Robber

class Solution {public: int rob(vector<int>& nums) { int arr[2]={}; int i(0); bool f(0); for(;i!=nums.size();++i,f=!f) { arr[f]=max(...

2019-05-07 23:52:07 110

原创 leetcode - 621. Task Scheduler

class Solution {public: int leastInterval(vector<char>& tasks, int n) { int size=tasks.size(); if(size==1) return 1; vector<int> time(26,0); int ...

2019-04-11 16:37:16 85

原创 leetcode - 560. Subarray Sum Equals K

class Solution {public: int subarraySum(vector<int>& nums, int k) { int n=nums.size(),ret(0),i; unordered_map<int,int>map; if(!n) return 0; int *p...

2019-04-11 14:52:01 102

原创 leetcode - 309. Best Time to Buy and Sell Stock with Cooldown

class Solution {public: int maxProfit(vector<int>& prices){ int n=prices.size(); vector<int>un(n+1,0); vector<int>ho(n+1,0); if(n<2) ret...

2019-04-10 22:05:38 84

原创 leetcode - 406. Queue Reconstruction by Height

class Solution {public: static bool cmp1(pair<int,int> a,pair<int,int> b) { return a.first<b.first; } vector<pair<int, int>> reconstructQueue(vecto...

2019-04-10 21:12:39 112

原创 leetcode - 322. Coin Change

class Solution {public: int coinChange(vector<int>& coins, int amount) { int *dp=new int[amount+1]; fill(dp,dp+amount+1,-1); dp[0]=0; int x,i; f...

2019-04-10 20:37:28 94

原创 leetcode - 287. Find the Duplicate Number

class Solution {public: int findDuplicate(vector<int>& nums) { int s=nums[0],f=nums[s]; while(f!=s) { s=nums[s]; f=nums[nums[f]]; ...

2019-04-10 16:57:01 111

原创 leetcode - 279. Perfect Squares

常规解法是dp,但是要几十毫秒,特殊解法利用了四平方和定理。class Solution {public: int numSquares(int n) { while (!(n & 3)) n >>= 2; if (n % 8 == 7) return 4; int i=1,j=sqrt(n); ...

2019-04-10 16:30:07 98

原创 leetcode - 238. Product of Array Except Self

class Solution {public: vector<int> productExceptSelf(vector<int>& nums) { int pro(1),count(0); vector<int> ret(nums.size(),0); for(int i=0;i<num...

2019-04-09 21:42:48 91

原创 leetcode - 221. Maximal Square

class Solution {public: int maximalSquare(vector<vector<char>>& matrix) { if(!matrix.size()) return 0; int m=matrix.size()+1,n=matrix[0].size()+1; int **p...

2019-04-09 21:37:16 107

原创 leetcode - 215. Kth Largest Element in an Array

class Solution {public: void reflesh(int *p,int k,int i) { int x=p[i]; int s=2*i+1; while(s<k) { if((s+1)<k&&p[s+1]<p[s]) { ...

2019-04-09 20:55:18 108

原创 leetcode - 208. Implement Trie (Prefix Tree)

class Trie {private: struct point{ char x; point* next[26]; bool end; point(char s):x(s),end(0) { for(auto &i:next) i=NULL; } ...

2019-04-09 19:44:29 146

原创 leetcode - 207. Course Schedule

class Solution {public: bool canFinish(int numCourses, vector<pair<int, int>>& prerequisites) { int *p=new int[numCourses]; fill(p,p+numCourses,0); vector...

2019-04-08 21:29:11 109

原创 leetcode - 152. Maximum Product Subarray

class Solution {public: int maxProduct(vector<int>& nums) { if(!nums.size()) return 0; vector<int>::iterator it=nums.begin(); int ma(*it),mi(*it),map,mip,...

2019-04-08 20:29:18 123

原创 leetcode - 148. Sort List

class Solution {public: ListNode* mer(ListNode* p1,ListNode* p2) { if(!p1) return p2; if(!p2) return p1; ListNode *head,*ret; if(p1->val>p2->val) ...

2019-04-08 20:02:31 73

原创 leetcode - 142. Linked List Cycle II

/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode *d...

2019-04-08 16:29:20 171

原创 leetcode - 114. Flatten Binary Tree to Linked List

/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */cla...

2019-04-08 16:10:55 95

原创 leetcode - 96. Unique Binary Search Trees

class Solution {public: int numTrees(int n) { if(n<2) return 1; int *dp=new int[n+1]; int i,j,k; dp[0]=dp[1]=1; for(i=2;i<=n;++i) { ...

2019-04-08 15:19:05 95

原创 leetcode - 105. Construct Binary Tree from Preorder and Inorder Traversal

/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */cla...

2019-04-08 15:07:01 82

原创 leetcode - 79. Word Search

class Solution {public: bool visit(vector<vector<char>>& board, string & word,int i,int j,int n,bool **p) { if(p[i][j]) return 0; if(word[n]!=board[i][j])...

2019-04-08 14:28:02 110

原创 leetcode - 94. Binary Tree Inorder Traversal

class Solution {public: void visit(vector<int> & ret, TreeNode* root) { if(root->left) visit(ret,root->left); ret.push_back(root->val); if(root-&gt...

2019-04-07 21:47:57 114

原创 leetcode - 75. Sort Colors

class Solution {public: void sortColors(vector<int>& nums) { int p[3]={}; for(auto it:nums) { ++p[it]; } int i=0; for(int j=...

2019-04-07 21:42:25 127

原创 leetcode - 78. Subsets

class Solution {public: vector<vector<int>> subsets(vector<int>& nums) { vector<vector<int>> ret; int i,end; vector<int> num; ...

2019-04-07 21:33:39 99

原创 leetcode - 62. Unique Paths

class Solution {public: int uniquePaths(int m, int n) { long long ret(1); int i(0); if(m<n) swap(m,n); --n; for(m;i<n;++i,++m) { ...

2019-04-07 21:28:37 91

原创 leetcode - 56. Merge Intervals

/** * Definition for an interval. * struct Interval { * int start; * int end; * Interval() : start(0), end(0) {} * Interval(int s, int e) : start(s), end(e) {} * }; */class S...

2019-04-07 21:13:31 112

原创 leetcode - 55. Jump Game

class Solution {public: bool canJump(vector<int>& nums) { int maxw(0),n=nums.size(); for(int i=0;i<n&&i<=maxw;++i) { maxw=max(maxw,num...

2019-04-07 20:58:50 103

原创 leetcode - 49. Group Anagrams

class Solution {public: vector<vector<string>> groupAnagrams(vector<string>& strs) { string s; vector<vector<string>> ret; vector<str...

2019-04-07 20:40:56 143

原创 leetcode - 46. Permutations

class Solution {public: vector<vector<int> > permute(vector<int> &num) { vector<vector<int> > ret; sort(num.begin(), num.end()); r...

2019-04-07 20:21:57 112

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除