
Python3
文章平均质量分 87
Azu機
这个作者很懒,什么都没留下…
展开
-
算法设计与分析:Kth Largest Element in an Array(Week 2)
学号:16340008Question:Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.Example 1:Input: [3,2,1,5,6,4]...原创 2018-09-15 00:00:07 · 198 阅读 · 0 评论 -
如何利用UDP实现TCP的可靠传输
报告:https://github.com/c980129/TCP/blob/master/%E5%AE%9E%E9%AA%8C%E6%8A%A5%E5%91%8A.pdf代码:https://github.com/c980129/TCP原创 2019-03-06 23:38:41 · 2664 阅读 · 0 评论 -
利用opencv与python3 JPEG压缩与解压实现
由于内容是从写好的word文件中复制过来,可能排版等会有各种问题,建议直接看github中的pdf另外由于我写这份作业的时候还不熟悉py3,因此实际上由很多可以优化的地方,比如数组强烈建议使用numpy而不是此处的列表github地址:https://github.com/c980129/JPEGJPEG压缩实现(Python3)RGB转YUVJPEG会将彩色图像执行...原创 2019-03-06 23:30:58 · 12792 阅读 · 8 评论 -
python3 SA模拟退火算法解决100个城市的TSP问题
由于内容是从自己写的报告(word文件)中复制而来,因此排版可能有问题,建议直接看github中的报告pdf地址:https://github.com/c980129/Simulated-annealing-algorithm摘要:该项目主要是利用局部搜索算法(LS)和模拟退火算法(SA)解决TSP问题。先是使用LS求解TSP问题,再尝试SA问题,比较两者,在效率上SA更占有。最后再...原创 2019-03-06 23:25:36 · 4253 阅读 · 1 评论 -
Capacitated Facility Location Problem (Algorithm Design and Analysis Project)
学号:16340008目录QuestionAnswer算法①:模拟退火算法 算法②:贪心算法 CommentsReferenceQuestion:Suppose there are n facilities and m customers. We wish to choose:which of the n facilities to open the as...原创 2018-12-23 18:27:23 · 253 阅读 · 0 评论 -
算法设计与分析:01 Matrix(Week 14)
学号:16340008题目:542. 01 MatrixQuestion:Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.The distance between two adjacent cells is 1.Example 1: Input:0 ...原创 2018-12-11 11:29:21 · 236 阅读 · 0 评论 -
算法设计与分析:Student Attendance Record II(Week 13)
学号:16340008题目:552. Student Attendance Record IIQuestion: Given a positive integer n, return the number of all possible attendance records with length n, which will be regarded as rewardable. Th...原创 2018-12-02 03:20:48 · 350 阅读 · 0 评论 -
算法设计与分析:Coin Change(Week 12)
学号:16340008题目:322. Coin ChangeQuestion:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to ...原创 2018-11-24 02:47:30 · 404 阅读 · 0 评论 -
算法设计与分析:Minimum Number of Refueling Stops(Week 11)
学号:16340008题目:871. Minimum Number of Refueling StopsQuestion:A car travels from a starting position to a destination which is target miles east of the starting position.Along the way, there ar...原创 2018-11-17 04:12:23 · 198 阅读 · 0 评论 -
算法设计与分析:New 21 Game(Week 10)
学号:16340008题目:837. New 21 GameQuestion:Alice plays the following game, loosely based on the card game "21".Alice starts with 0 points, and draws numbers while she has less than K points. Duri...原创 2018-11-08 02:17:29 · 269 阅读 · 0 评论 -
算法设计与分析:Edit Distance(Week 9)
学号:16340008题目:72. Edit DistanceQuestion:Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2.You have the following 3 operations permitted ...原创 2018-11-04 01:39:52 · 202 阅读 · 0 评论 -
算法设计与分析:Scramble String(Week 8)
学号:16340008题目:87. Scramble StringQuestion:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representatio...原创 2018-10-27 16:20:52 · 268 阅读 · 0 评论 -
算法设计与分析:Burst Balloons(Week 6)
学号:16340008题目:312. Burst BalloonsQuestion:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons....原创 2018-10-13 21:54:45 · 273 阅读 · 0 评论 -
算法设计与分析:Jump Game II(Week 7)
学号:16340008题目:Jump Game IIQuestion:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump ...原创 2018-10-17 21:23:51 · 226 阅读 · 0 评论 -
算法设计与分析:Word Ladder(Week 4)
学号:16340008题目:127. Word LadderQuestion:Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such ...原创 2018-09-27 18:36:26 · 5092 阅读 · 0 评论 -
算法设计与分析:Surrounded Regions(Week 3)
学号:16340008Question:Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded region....原创 2018-09-21 14:13:54 · 209 阅读 · 0 评论 -
算法设计与分析:K-Similar Strings(Week 5)
学号:16340008题目:854. K-Similar StringsQuestion:Strings A and B are K-similar (for some non-negative integer K) if we can swap the positions of two letters in A exactly K times so that the resultin...原创 2018-10-03 20:06:23 · 332 阅读 · 0 评论 -
【Python爬虫练手】lhscan扫图一键下载,搬运辉夜生肉以及制熟肉可用
之前在lhscan上下扫图时发现使用网站自带的一键download的话下载下来的图片是加密的因此如果在该网站搬运只能手动右键存图(而且文件名无顺序逻辑或许是因为没有账号或是其他原因这个小程序就是在这样背景下写出来的(假如申请账号就能解决加密的话就白写了因为是境外网站,使用时如果连接慢或者连接失败,请尝试挂梯子或更换节点如果依旧无法连接,请尝试使用浏览器打开网站,如果无法打开则是网站服务器...原创 2019-06-17 13:55:16 · 4316 阅读 · 3 评论