自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(245)
  • 资源 (6)
  • 收藏
  • 关注

原创 leetcode 解题目录索引 Python3 一步一步持续更新~

记录每一道题的解题url, 便于以后ctrl+find找到。都是详解思路以及相关证明,而不是单单只有一份代码,尽可能总结每道题多种解决思路。涉及到复杂的知识点会给一些参考链接。如果有新的解题思路可以在题目下留言评论,会更新。因为楼主目前学业压力比较大,尽量一天1~2道题,希望有生之年能全写完。。。当然是记录自己的解题。leetcode 1. two sumleetco...

2019-12-02 23:49:11 683

原创 leetcode 32. Longest Valid Parentheses Python3 解

一.问题描述Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.Example 1:Input: s = "(()"Output: 2Explanation: The longest valid parentheses substring is "()".Example...

2020-12-10 20:05:53 317 2

原创 leetcode 30. Substring with Concatenation of All Words Python3

一.问题描述You are given a stringsand an array of stringswordsofthe same length. Returnall starting indices of substring(s) insthat is a concatenation of each word inwordsexactly once,in any order,andwithout any intervening characters.You can r...

2020-10-17 17:02:08 348

原创 leetcode 25. Reverse Nodes in k-Group Python3 递归+迭代

一.问题描述Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.kis a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple ofkthen left-out nodes...

2020-10-16 21:03:21 308

原创 leetcode 23. Merge k Sorted Lists Python3 多解

一.问题描述You are given an array ofklinked-listslists, each linked-list is sorted in ascending order.Merge all the linked-lists into one sorted linked-list and return it.Example 1:Input: lists = [[1,4,5],[1,3,4],[2,6]]Output: [1,1,2,3,4,4,5,6]...

2020-10-16 00:43:46 281

原创 Leetcode 10. Regular Expression Matching Python3 递归与动态规划

一.问题描述Given an input string (s) and a pattern (p), implement regular expression matching with support for'.'and'*'where:'.'Matches any single character.​​​​ '*'Matches zero or more of the preceding element.The matching should cover theentire...

2020-10-15 00:46:46 265

原创 ECCV20| Mining Cross-Image Semantics for Weakly Supervised Semantic Segmentation 解读

论文地址:Mining Cross-Image Semantics for Weakly Supervised Semantic Segmentation概述:本篇论文是由来自苏黎世联邦理工学院和上海交通大学的Guolei Sun等人提出,被ECCV 2020(oral)接收。其旨在通过挖掘跨图像的语义信息来促进弱监督语义分割(WSSS)任务。具体来说,他们提出了一个 co-attention (共同注意力) 机制和 contrastive (对比共同注意力) 机制来帮助分类器更好的学习物体的模式 (p

2020-10-04 21:40:19 1163 2

原创 UserWarning: This overload of nonzero is deprecated: nonzero(Tensor input, Tensor out) 解决

问题:../torch/csrc/utils/python_arg_parser.cpp:738: UserWarning: This overload of nonzero is deprecated: nonzero(Tensor input, Tensor out)Consider using one of the following signatures instead: nonzero(Tensor input, bool as_tuple)解决:.

2020-09-20 18:08:30 2851

原创 剑指offer JZ27 字符串的排列 Python 多解

一.题目描述输入一个字符串,按字典序打印出该字符串中字符的所有排列。例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba。输入描述:输入一个字符串,长度不超过9(可能有字符重复),字符只包括大小写字母。二.解题思路1.递归+dfs深度优先搜索。要注意本题的输出要求字典序输出。如何字典序的获得一个字符串的全排列?我们可以这样想,假设字符串s长为n,我们已知基于s的2~n位的子字符串的全排列,将第一个字.

2020-07-18 23:48:40 252

原创 剑指offer JZ52 正则表达式匹配 Python 多解

一.题目描述请实现一个函数用来匹配包括'.'和'*'的正则表达式。模式中的字符'.'表示任意一个字符,而'*'表示它前面的字符可以出现任意次(包含0次)。 在本题中,匹配是指字符串的所有字符匹配整个模式。例如,字符串"aaa"与模式"a.a"和"ab*ac*a"匹配,但是与"aa.a"和"ab*a"均不匹配二.解题思路<1>递归首先分析一下匹配可能的集中情况。1.s和pattern都为空:返回True2.s不为空pattern为空:返回False3.s为空,patte

2020-07-17 10:43:49 278

原创 剑指offer JZ43 左旋转字符串 Python 多解

一.题目描述汇编语言中有一种移位指令叫做循环左移(ROL),现在有个简单的任务,就是用字符串模拟这个指令的运算结果。对于一个给定的字符序列S,请你把其循环左移K位后的序列输出。例如,字符序列S=”abcXYZdef”,要求输出循环左移3位后的结果,即“XYZdefabc”。是不是很简单?OK,搞定它!二.解题思路1.空间复杂度O(N),时间复杂度O(N)a.将字符串n~末尾和0~n拼接起来返回,这用python很容易实现。b.将两个相同的字符串s拼接,然后返回s[n~len(s)+n)]

2020-07-16 12:37:15 245

原创 剑指offer JZ53 表示数值的字符串 Python 多解

一.题目描述请实现一个函数用来判断字符串是否表示数值(包括整数和小数)。例如,字符串"+100","5e2","-123","3.1416"和"-1E-16"都表示数值。 但是"12e","1a3.14","1.2.3","+-5"和"12e+4.3"都不是。二.解题思路首先分析一下不是数字的情况:1.出现的字符不是合理的数字或者符号位、e/E等,如'a'.2.小数点,e出现超过1次。3.小数点,e,符号出现在字符串末尾4.符号位不是出现在最高位,如第一位或者e的后面。5.e

2020-07-15 18:36:42 235

原创 剑指offer JZ54 字符流中第一个不重复的字符 Python 多解

一.问题描述请实现一个函数用来找出字符流中第一个只出现一次的字符。例如,当从字符流中只读出前两个字符"go"时,第一个只出现一次的字符是"g"。当从该字符流中读出前六个字符“google"时,第一个只出现一次的字符是"l"。输出描述:如果当前字符流没有存在出现一次的字符,返回#字符。二.解题思路这道题如果是要O(n)解法,就十分简单,我们在这就不探讨了,在这主要介绍两个O(1)时间复杂度的解法。1.时间复杂度: O(1),空间复杂度: O(n)用一个集合来保存所有曾经出现过的字符

2020-07-14 10:45:07 321

原创 剑指offer JZ45 扑克牌顺子 Python 解

一.题目描述LL今天心情特别好,因为他去买了一副扑克牌,发现里面居然有2个大王,2个小王(一副牌原本是54张^_^)...他随机从中抽出了5张牌,想测测自己的手气,看看能不能抽到顺子,如果抽到的话,他决定去买体育彩票,嘿嘿!!“红心A,黑桃3,小王,大王,方片5”,“Oh My God!”不是顺子.....LL不高兴了,他想了想,决定大\小 王可以看成任何数字,并且A看作1,J为11,Q为12,K为13。上面的5张牌就可以变成“1,2,3,4,5”(大小王分别看作2和4),“So Lucky!”。LL决

2020-07-13 11:30:53 252

原创 剑指offer JZ02 替换空格 Python 解

一.题目描述请实现一个函数,将一个字符串中的每个空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。二.解题思路这道题其实主要是考察inplace的修改,即在原变量上,不申请新的对象,进行修改。C/C++,Java传的参数都是可变长的字符串变量。比如char指针和StringBuffer.但是对于python来说就没有,不过按照思路来说还是讲一讲。1.新开一个空字符串rst,一次遍历原字符串,如果不是空格,则将原字

2020-07-12 11:43:23 224

原创 剑指offer JZ31 整数中1出现的次数 Python 解

一.题目描述求出1~13的整数中1出现的次数,并算出100~1300的整数中1出现的次数?为此他特别数了一下1~13中包含1的数字有1、10、11、12、13因此共出现6次,但是对于后面问题他就没辙了。ACMer希望你们帮帮他,并把问题更加普遍化,可以很快的求出任意非负整数区间中1出现的次数(从1 到 n 中1出现的次数)。二.解题思路1.暴力法:从1~n迭代,计算每个数字中1的数量然后累加。复杂度应该是 O(NlgN)2.归纳法:2.1简单来说,分别归纳个位,十位和百位上1的出现次

2020-07-10 12:42:30 264

原创 剑指offer JZ06 旋转数组的最小数字 Python解

一.题目描述把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个非递减排序的数组的一个旋转,输出旋转数组的最小元素。例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,该数组的最小值为1。NOTE:给出的所有元素都大于0,若数组大小为0,请返回0。二.解题思路1.一次扫描:O(N),从头开始扫描数组,发现当前元素比前一元素小,说明是最小元素。注意边界处理。2.二分法:具体来说三种情况:1.array[mid]<array[high]:说

2020-07-09 19:32:03 305 2

原创 剑指offer JZ01 二维数组中的查找 Python 多解

一.题目描述在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。二.解题思路要注意数组的有序信息1.暴力穷举:O(M*N)2.单折半:O(M*logN):迭代每一行,每一行是有序的,二分搜索3.左下/右上(M+N):右上是该行和该列(该元素所在列以上的元素)所有元素里最大,若target比该元素大,则只能向下移动一行,小的话则遍历当前行。每次可以

2020-07-08 21:27:32 367

原创 leetcode 22. Generate Parentheses 递归+迭代 python3

一.问题描述Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:[ "((()))", "(()())", "(())()", ...

2020-03-27 21:39:39 278

原创 leetcode 46. Permutations 迭代+递归 python3

一.问题描述Given a collection ofdistinctintegers, return all possible permutations.Example:Input: [1,2,3]Output:[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]二.解题思路主要是有...

2020-03-25 19:00:11 370

翻译 What‘s the Point: Semantic Segmentation with Point Supervision 翻译与简单注解

声明:本篇为原论文的翻译,限于博主的知识,可能有翻译或理解不对的地方,若发现请在评论区留言更改。省略related work和致谢部分。所有的公式,图均来自原文。原文:What’s the Point: Semantic Segmentation with Point SupervisionAbstract:语义分割任务在测试准确率和训练注解成本之间获取平衡。细致的每像素注解能训练准确...

2020-02-01 08:30:11 2824

原创 leetcode 1299. Replace Elements with Greatest Element on Right Side 详解 python3

一.问题描述Given an arrayarr,replace every element in that array with the greatest element among the elements to itsright, and replace the last element with-1.After doing so, return the array....

2020-01-28 18:04:27 804

原创 leetcode 1331. Rank Transform of an Array 详解 python3

一.问题描述Given an array of integersarr, replace each element with its rank.The rank represents how large the element is. The rank has the following rules:Rank is an integer starting from 1. The l...

2020-01-27 18:01:53 717

原创 leetcode 1332. Remove Palindromic Subsequences 详解 python3

一.问题描述Given a stringsconsisting only ofletters'a'and'b'. In a single step you can remove onepalindromicsubsequencefroms.Return the minimum number of steps to make the given string empty....

2020-01-26 18:55:22 1091

原创 leetcode 1304. Find N Unique Integers Sum up to Zero 详解 python3

一.问题描述Given an integern, returnanyarray containingnuniqueintegers such that they add up to 0.Example 1:Input: n = 5Output: [-7,-1,1,3,4]Explanation: These arrays also are accepted [-...

2020-01-24 17:21:40 1014

原创 leetcode 1309. Decrypt String from Alphabet to Integer Mapping 详解 python3

一.问题描述Given a stringsformed by digits ('0'-'9')and'#'.We want to mapsto English lowercase characters as follows:Characters ('a'to'i')arerepresented by('1'to'9')respectively. Cha...

2020-01-23 21:57:36 478

原创 leetcode 1313. Decompress Run-Length Encoded List 详解 python3

一.问题描述We are given a listnumsof integers representing a list compressed with run-length encoding.Consider each adjacent pairof elements[a, b] = [nums[2*i], nums[2*i+1]](withi >= 0). For ...

2020-01-22 17:56:32 1142

原创 leetcode 1317. Convert Integer to the Sum of Two No-Zero Integers 详解 python3

一.问题描述Given an integern. No-Zero integer is a positive integer whichdoesn't contain any 0in its decimal representation.Returna list of two integers[A, B]where:AandBare No-Zero integers....

2020-01-21 20:15:46 620 2

原创 leetcode 1323. Maximum 69 Number 详解 python3

一.问题描述Given a positive integernumconsisting only of digits 6 and 9.Return the maximum number you can get by changingat mostone digit (6 becomes 9, and 9 becomes 6).Example 1:Input: num...

2020-01-20 16:26:03 749

原创 leetcode 7. Reverse Integer 详解 python3

一.问题描述Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume we...

2020-01-19 17:22:48 494

原创 leetcode 204. Count Primes 埃拉托斯特尼筛法 python3

一.问题描述Count the number of prime numbers less than a non-negative number,n.Example:Input: 10Output: 4Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.二.解题思路最基本的方法:...

2020-01-18 19:30:00 788

原创 leetcode 189. Rotate Array O(1)内存 python3

一.问题描述Given an array, rotate the array to the right byksteps, wherekis non-negative.Example 1:Input: [1,2,3,4,5,6,7] and k = 3Output: [5,6,7,1,2,3,4]Explanation:rotate 1 steps to the rig...

2020-01-18 00:14:08 243 2

原创 leetcode 69. Sqrt(x) 二分法 python3

一.问题描述Implementint sqrt(int x).Compute and return the square root ofx, wherexis guaranteed to be a non-negative integer.Since the return typeis an integer, the decimal digits are truncated ...

2020-01-16 18:28:50 460

原创 leetcode 28. Implement strStr() 详解 python3

一.问题描述ImplementstrStr().Return the index of the first occurrence of needle in haystack, or-1if needle is not part of haystack.Example 1:Input: haystack = "hello", needle = "ll"Output: 2...

2020-01-15 19:11:35 370

原创 leetcode 125. Valid Palindrome 正则 python3

学期考试结束,重新开始刷leetcode!一.问题描述Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.Note:For the purpose of this problem, we define empty str...

2020-01-14 19:39:53 281

原创 leetcode 190. Reverse Bits 位操作 python3

一.问题描述Reverse bits of a given 32 bits unsigned integer.Example 1:Input: 00000010100101000001111010011100Output: 00111001011110000010100101000000Explanation: The input binary string 0000001...

2019-12-12 01:09:50 233

原创 leetcode 14. Longest Common Prefix 二分法 python3

一.问题描述Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string"".Example 1:Input: ["flower","flow","flight"]...

2019-12-11 06:23:55 255

原创 leetcode 160. Intersection of Two Linked Lists 常数内存 python3

一.问题描述Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:begin to intersect at node c1.Example 1:...

2019-12-10 01:20:30 245

原创 leetcode 234. Palindrome Linked List 常数内存 python3

一.问题描述Given a singly linked list, determine if it is a palindrome.Example 1:Input: 1->2Output: falseExample 2:Input: 1->2->2->1Output: trueFollow up:Could you do it in O(n...

2019-12-07 19:59:57 179

原创 leetcode 88. Merge Sorted Array 详解 python3

一.问题描述Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:The number of elements initialized innums1andnums2aremandnrespectively. You may as...

2019-12-06 19:47:08 398

华三官方广域网教学PPT(V7版本)

华三官方广域网教学PPT(V7版本)

2018-11-03

华三官方高性能园区教学PPT(V7版本)

华三官方高性能园区教学PPT(V7版本)

2018-11-03

华三官方大规模路由技术教学PPT(V7版本)

华三官方大规模路由技术教学PPT(V7版本)  

2018-11-03

H3CSE题库2018-V7

H3CSE题库2018V7版本,覆盖路由,园区和安全三个,答案含解析。

2018-11-03

AES加密C++源码

aes加密的C++源码,aes加密的C++源码,aes加密的C++源码,aes加密的C++源码,aes加密的C++源码

2017-12-01

自己动手写爬虫pdf+源码

自己动手写爬虫pdf+源码,自己动手写爬虫pdf+源码,自己动手写爬虫pdf+源码,自己动手写爬虫pdf+源码

2017-11-29

空空如也

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

TA关注的人

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