摘要:problem 492. Construct the Rectangle solution1: solution2: 参考 1. Leetcode_492. Construct the Rectangle; 2. GrandYang; 完
阅读全文
摘要:problem 485. Max Consecutive Ones solution1: 参考 1. Leetcode_485. Max Consecutive Ones; 完
阅读全文
摘要:win10安装ubuntu16.04双系统 Win10+Ubuntu双系统删除Ubuntu方法 Win10+Ubuntu双系统删除Ubuntu方法 https://www.cnblogs.com/pualus/p/7835422.html UEFI启动Windows10+Ubuntu双系统删除Ubu
阅读全文
摘要:前言 博主想使用caffe框架进行深度学习相关网络的训练和测试,刚开始做,特此记录学习过程。 环境配置方面,博主以为最容易卡壳的是GPU的NVIDIA驱动的安装和CUDA的安装,前者尝试的都要吐了,可以参见here.关于CUDA的安装,主要需要检查各个相关方面是否满足版本的匹配,最重要的是NVIDI
阅读全文
摘要:problem 482. License Key Formatting solution1: 倒着处理,注意第一个字符为分隔符的情况要进行删除,注意字符的顺序是否正序。 参考 1. Leetcode_482. License Key Formatting; 2. GrandYang; 完
阅读全文
摘要:problem 476. Number Complement solution1: 参考 1. Leetcode_476. Number Complement; 2. GrandYang; 完
阅读全文
摘要:problem 475. Heaters solution1: 博主的理解就是计算每个house对应的能够cover到的最小值,注意两个数组有先进行排序哦,然后cover每个house的最小值中的最大值即为所求解的能够cover每个house的最小值。 参考 1. Leetcode_475. Hea
阅读全文
摘要:problem 463. Island Perimeter solution: 参考 1. Leetcode_463. Island Perimeter; 完
阅读全文
摘要:problem 461. Hamming Distance solution1: 根据题意,所求汉明距离指的是两个数字的二进制对应位不同的个数。对应位异或操作为1的累积和。 solution2: 两个数字异或之后,统计结果二进制中1的个数。 注意,两种solution都是移动 i 个位置。 参考 1
阅读全文
摘要:Tx2刷机 注意python的版本问题。 问题 参考here 最后可以编译成功。 运行mnist的example时出现错误 怀疑是GPU驱动的问题,与别人交流,说是TX2刷机的时候已经内置的有GPU,验证CUDA实例也证明CUDA正确安装,显示驱动是NVIDIA Tegra2。不过,不能用于caff
阅读全文
摘要:参考 1. https://blog.csdn.net/tyhj_sf/article/details/79932893; 完
阅读全文
摘要:参考 1. https://blog.csdn.net/weixin_41055137/article/details/81174443 完
阅读全文
摘要:参考 1. https://blog.csdn.net/xiaodong_11/article/details/81985700; 完
阅读全文
摘要:参考 1. https://www.cnblogs.com/zf-blog/p/6075286.html; 完
阅读全文
摘要:problem 459. Repeated Substring Pattern solution1: 这道题给了我们一个字符串,问其是否能拆成n个重复的子串。那么既然能拆分成多个子串,那么每个子串的长度肯定不能大于原字符串长度的一半,那么我们可以从原字符串长度的一半遍历到1,如果当前长度能被总长度整
阅读全文
摘要:problem 455. Assign Cookies solution1: 对小朋友的满意程度(也就是胃口)和当前cookies的大小分别进行排序,满足一个小朋友则加1;否则比较下一个cookie是否满足小朋友。记住前提是每个小朋友最多只能得到一个cookie.也就是贪婪算法。 solution2
阅读全文
摘要:problem 453. Minimum Moves to Equal Array Elements 相当于把不等于最小值的数字都减到最小值所需要次数的累加和。 solution1: 记得初始化,否则默认初始值是最小值。 solution2: 换一种思路,就是数组之和减去最小值乘以数组长度之积。 参
阅读全文
摘要:problem 448. Find All Numbers Disappeared in an Array solution: 参考 1. Leetcode_448. Find All Numbers Disappeared in an Array; 2. GrandYang; 完
阅读全文
摘要:https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html https://docs.nvidia.com/cuda/archive/9.2/cuda-installation-guide-linux/index.html T
阅读全文
摘要:https://blog.csdn.net/lzzyok/article/details/77413968 https://blog.csdn.net/tiweeny/article/details/78384633 https://www.cnblogs.com/Jeb15/p/6080331.h
阅读全文
摘要:problem 447. Number of Boomerangs 也就是回旋镖的数量问题,以一个点为端点,若存在n个相等的点,那么就有两种情况可以构成三元数组,abc和acb是不同,也就是排列问题,有n(n-1)个。那么遍历每个点存在的三元数组求和即为所求。 re: 1. Leetcode_447
阅读全文
摘要:problem 443. String Compression a: ss ss solution1: class Solution { public: int compress(vector<char>& chars) { if(chars.empty()) return 0; string re
阅读全文
摘要:problem 441. Arranging Coins solution1: solution2: solution3: 参考 1. Leetcode_441. Arranging Coins; 完
阅读全文
摘要:前言 应领导要求需要将最初级版本的算法移植到ARM板子上,并进行优化,以期达到实时。 平台 移植前: TX2 移植后: ARM() 背景:最早版本在TX2上运行时间大约有60ms左右。 具体操作 1.ARM环境配置 说实话,这次移植只是将平台换成了ARM,仍然是在ubuntu系统上运行,没什么大的问
阅读全文
摘要:problem 438. Find All Anagrams in a String solution1: class Solution { public: vector<int> findAnagrams(string s, string p) { if(s.empty()) return {};
阅读全文
摘要:problem 437. Path Sum III 参考 1. Leetcode_437. Path Sum III; 完
阅读全文
摘要:problem 434. Number of Segments in a String solution1: 当前字符不为空且前一个字符为空,或者字符串首字符不为空,则为一个分割串。利用的是每一个分割串的前一个字符为空的特性,注意第一个分割串。 参考 1. Leetcode_434. Number
阅读全文
摘要:problem 429. N-ary Tree Level Order Traversal solution1:Iteration 参考 1. Leetcode_429. N-ary Tree Level Order Traversal; 完
阅读全文
摘要:problem 427. Construct Quad Tree 参考 1. Leetcode_427. Construct Quad Tree; 完
阅读全文
摘要:problem 415. Add Strings solution: 参考 1. Leetcode_415. Add Strings; 完
阅读全文
摘要:problem 414. Third Maximum Number solution 思路:用三个变量first, second, third来分别保存第一大、第二大和第三大的数,然后遍历数组。 注意: 1. 数据类型对应的最小值表示; 2. 赋值时需要判断是否为最小值; 参考 1. Leetcod
阅读全文
摘要:problem 412. Fizz Buzz solution: 参考 1. Leetcode_412. Fizz Buzz; 完
阅读全文
摘要:problem 409. Longest Palindrome solution1: 参考 1. Leetcode_409. Longest Palindrome; 完
阅读全文
摘要:由于红外补光灯的爆闪,所以一般DMS会用global shutter的sensor,而不是rolling shutter的。 全局快门 (global shutter),其特点是sensor 上所有像素是在同一瞬间全部开始曝光的,因此sensor 采集的是物体在同一时间点的画面。 卷帘曝光的最显著特
阅读全文
摘要:problem Sum of Two Integers 不知道为什么一直出错; runtime error: left shift of negative value -2147483648 (solution.cpp) 参考 1. Leetcode_Sum of Two Integers; 完 不
阅读全文
摘要:problem 367. Valid Perfect Square solution:二分法; solution2: 纯数学解法,利用到了这样一条性质,完全平方数是一系列奇数之和; 时间复杂度为O(sqrt(n)) 其他两种方法都出现超时的问题。 参考 1. Leetcode_367. Valid
阅读全文