自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(83)
  • 资源 (5)
  • 论坛 (2)
  • 收藏
  • 关注

原创 LeetCode 221. Maximal Square

题目链接:最大正方形 - 力扣 (LeetCode)Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing only 1’s and return its area.Example:Input: 1 0 1 0 01 0 1 1 11 1 1 1 11 0 0 1 0...

2018-12-31 23:03:35 82

原创 LeetCode 322. Coin Change

题目链接:零钱兑换 - 力扣 (LeetCode)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 make up that amount...

2018-12-31 21:45:20 115

原创 年记 2018,新年快乐

2018年的最后一夜晚与前364个夜晚没有什么区别,只是今天又有了特别正当的熬夜理由,晚上得和朋友们道声新年快乐啊。作为一个大学生,夜里的感觉总是挺不错的,只是宿舍里冬天会有一点冷,夏天会有一点热。希望以后考上研的话宿舍可以有空调 - -2018年可能有一个转折点,应该是上个寒假,1月25日,或者26日。那天我开通了博客,发了我的第一篇博文。我告诉我妈,计算机大佬都有写博客的习惯,而且大家可以很...

2018-12-31 20:38:25 855 1

原创 329. Longest Increasing Path in a Matrix

矩阵中的最长递增路径 - 力扣 (LeetCode)Given an integer matrix, find the length of the longest increasing path.From each cell, you can either move to four directions: left, right, up or down. You may NOT move di...

2018-12-31 11:51:19 94 1

原创 LeetCode 338. Counting Bits

题目链接:比特位计数 - 力扣 (LeetCode)Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array....

2018-12-31 11:08:42 65

原创 流利阅读12.31 The science of giving gifts your loved ones won’t want to return

下载pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总本文内容全部来源于流利阅读。流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。The science of giving gifts your loved ones won’t want to return送礼的科学:怎样送礼你的挚爱不会退还?Tryi...

2018-12-31 10:46:31 790

原创 LeetCode 300. Longest Increasing Subsequence

Given an unsorted array of integers, find the length of longest increasing subsequence.Example:Input: [10,9,2,5,3,7,101,18]Output: 4 Explanation: The longest increasing subsequence is [2,3,7,101],...

2018-12-30 15:23:35 116

原创 LeetCode 354. Russian Doll Envelopes

题目链接:俄罗斯套娃信封问题 - 力扣 (LeetCode)You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and height of ...

2018-12-30 14:09:09 125

原创 LeetCode 63. Unique Paths II

题目链接:不同路径 II - 力扣 (LeetCode)A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either down or right at any point in time. The rob...

2018-12-30 12:34:35 56

原创 LeetCode 120. Triangle

题目链接:三角形最小路径和 - 力扣 (LeetCode)Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ ...

2018-12-30 12:01:11 56

原创 流利阅读12.30 The 20 best Marvel films – ranked!

下载pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。The 20 best Marvel films – ranked!二十部最佳漫威电影排名3 Blade II (2002)This sequel to 1998’s Blade was direct...

2018-12-30 11:32:04 1656

原创 LeetCode 464. Can I Win 【博弈 + 状压DP】

题目链接:我能赢吗 - 力扣 (LeetCode)In the “100 game,” two players take turns adding, to a running total, any integer from 1…10. The player who first causes the running total to reach or exceed 100 wins.What i...

2018-12-29 21:06:37 550

原创 LeetCode 79. Word Search

题目链接:单词搜索 - 力扣 (LeetCode)Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those hor...

2018-12-29 17:43:52 95

原创 LeetCode 756. Pyramid Transition Matrix

题目链接: 金字塔转换矩阵 - 力扣 (LeetCode)We are stacking blocks to form a pyramid. Each block has a color which is a one letter string, like 'Z'.For every block of color C we place not in the bottom row, we are...

2018-12-29 16:42:45 74

原创 LeetCode 341. Flatten Nested List Iterator

题目链接:扁平化嵌套列表迭代器 - 力扣 (LeetCode)Given a nested list of integers, implement an iterator to flatten it.Each element is either an integer, or a list – whose elements may also be integers or other lists....

2018-12-29 15:54:51 85

原创 LeetCode 394. Decode String

题目链接:字符串解码 - 力扣 (LeetCode)Given an encoded string, return it’s decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k...

2018-12-29 14:11:17 59

原创 LeetCode 95. Unique Binary Search Trees II

题目链接:不同的二叉搜索树 II - 力扣 (LeetCode)Given an integer n, generate all structurally unique BST’s (binary search trees) that store values 1 … n.Example:Input: 3Output:[ [1,null,3,2], [3,2,null,1], ...

2018-12-29 13:42:00 60

原创 LeetCode 96. Unique Binary Search Trees

题目链接:不同的二叉搜索树 - 力扣 (LeetCode)Given n, how many structurally unique BST’s (binary search trees) that store values 1 … n?Example:Input: 3Output: 5Explanation:Given n = 3, there are a total of 5 un...

2018-12-29 12:47:06 55

原创 流利阅读12.29 UK advertising watchdog to crack down on sexist stereotypes

下载pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。UK advertising watchdog to crack down on sexist stereotypes英国广告监管机构将打击带性别歧视的刻板印象Adverts showing a wom...

2018-12-29 12:07:27 742

原创 LeetCode 93. Restore IP Addresses

题目链接:复原IP地址 - 力扣 (LeetCode)Given a string containing only digits, restore it by returning all possible valid IP address combinations.Example:Input: "25525511135"Output: ["255.255.11.135", "255.255...

2018-12-28 20:51:14 69

原创 LeetCode 961.重复 N 次的元素

在大小为 2N 的数组 A 中有 N+1 个不同的元素,其中有一个元素重复了 N 次。返回重复了 N 次的那个元素。示例 1:输入:[1,2,3,3]输出:3示例 2:输入:[2,1,2,5,3,2]输出:2示例 3:输入:[5,1,5,2,5,3,5,4]输出:5重复N次的元素是唯一重复的元素class Solution {public: int rep...

2018-12-28 20:21:17 186 1

原创 LeetCode 257. Binary Tree Paths

题目链接:二叉树的所有路径 - 力扣 (LeetCode)Given a binary tree, return all root-to-leaf paths.Note: A leaf is a node with no children.Example:Input: 1 / \2 3 \ 5Output: ["1->2->5", "1-&gt...

2018-12-28 19:54:54 65

原创 LeetCode 77. Combinations

题目链接:组合 - 力扣 (LeetCode)Given two integers n and k, return all possible combinations of k numbers out of 1 … n.Example:Input: n = 4, k = 2Output:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1...

2018-12-28 19:18:34 56

原创 LeetCode 784. Letter Case Permutation

题目链接:字母大小写全排列 - 力扣 (LeetCode)Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible strings we could create...

2018-12-28 15:06:01 71

原创 LeetCode 130. Surrounded Regions

题目链接:被围绕的区域 - 力扣 (LeetCode)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-12-28 14:27:01 76

原创 LeetCode 200. Number of Islands

题目链接:岛屿的个数 - 力扣 (LeetCode)Given a 2d grid map of ‘1’s (land) and ‘0’s (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or...

2018-12-28 13:27:50 68

原创 LeetCode 733. Flood Fill

题目链接:图像渲染 - 力扣 (LeetCode)An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535).Given a coordinate (sr, sc) representing the sta...

2018-12-28 13:09:41 70

原创 流利阅读12.28 Seriously, Prada, what were you thinking? Why the fashion industry keeps bumbling into rac

下载pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。Seriously, Prada, what were you thinking? Why the fashion industry keeps bumbling into racist imagery说...

2018-12-28 12:13:21 727

原创 LeetCode 279. Perfect Squares

题目链接:完全平方数 - 力扣 (LeetCode)Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n.Example 1:Input: n = 12Output: 3 Explanation: 12...

2018-12-27 19:31:06 92

原创 LeetCode 111. Minimum Depth of Binary Tree

二叉树的最小深度 - 力扣 (LeetCode)Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.Note: A leaf is...

2018-12-27 14:09:39 58

原创 LeetCode 371. Sum of Two Integers

题目链接:两整数之和 - 力扣 (LeetCode)Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example 1:Input: a = 1, b = 2Output: 3Example 2:Input: a = -2, b = 3Out...

2018-12-27 13:22:01 92

原创 LeetCode 260. Single Number III

题目链接:只出现一次的数字 III - 力扣 (LeetCode)Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only...

2018-12-27 10:56:15 95

原创 LeetCode 137. Single Number II

题目链接: 只出现一次的数字 II - 力扣 (LeetCode)Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single one.Note:Your algorithm should h...

2018-12-27 10:39:53 78

原创 流利阅读12.27 Why life expectancy in America is down again

下载pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。Why life expectancy in America is down again为什么美国人口预期寿命再次下降Overall life expectancy in America fell fr...

2018-12-27 10:15:38 491

原创 LeetCode 476. Number Complement

题目链接:Number Complement - LeetCodeGiven a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note:The given integer is guarante...

2018-12-26 22:11:18 45

原创 LeetCode 136. Single Number

Given a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without usin...

2018-12-26 22:03:25 45

原创 LeetCode 762. 762. Prime Number of Set Bits in Binary Representation

题目链接:二进制表示中质数个计算置位 - 力扣 (LeetCode)Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime number of set bits in their binary representation.(Recall that ...

2018-12-26 19:36:00 71

原创 LeetCode 231. Power of Two

题目链接:2的幂 - 力扣 (LeetCode)Given an integer, write a function to determine if it is a power of two.Example 1:Input: 1Output: true Explanation: 20 = 1Example 2:Input: 16Output: trueExplanation: ...

2018-12-26 19:26:18 98

原创 LeetCode 227. Basic Calculator II

基本计算器 II - 力扣 (LeetCode)Implement a basic calculator to evaluate a simple expression string.The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The int...

2018-12-26 17:22:51 83

原创 LeetCode 131. Palindrome Partitioning

题目链接:Palindrome Partitioning - LeetCodeGiven a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.Example:Input: "aab...

2018-12-26 16:06:56 72

python爬取淘宝商品信息

import requests from bs4 import BeautifulSoup import bs4 def getHTMLText(url): try: r = requests.get(url, timeout=30) r.raise_for_status() r.encoding = r.apparent_encoding return r.text except: return "" def fillUnivList(ulist, html): soup = BeautifulSoup(html, "html.parser") for a in soup.find('tbody').children: if isinstance(a, bs4.element.Tag): tds = a('td') ulist.append([tds[0].string, tds[1].string, tds[2].string, tds[3].string]) def printUnivList(ulist, num): print("{:^10}\t{:^6}\t{:^6}\t{:^16}".format("排名","学校名称","地区","总分")) for i in range(num): u=ulist[i] print("{:^10}\t{:^6}\t{:^6}\t{:^16}".format(u[0],u[1],u[2],u[3]))

2018-01-26

调用sklearn库的K-Means聚类分析实例

#class sklearn.cluster.KMeans(n_clusters=8, init=’k-means++’, n_init=10, max_iter=300, tol=0.0001, precompute_distances=’auto’, verbose=0, random_state=None, copy_x=True, n_jobs=1, algorithm=’auto’) #参数: #(1)对于K均值聚类,我们需要给定类别的个数n_cluster,默认值为8; #(2)max_iter为迭代的次数,这里设置最大迭代次数为300; #(3)n_init设为10意味着进行10次随机初始化,选择效果最好的一种来作为模型; #(4)init=’k-means++’ 会由程序自动寻找合适的n_clusters; #(5)tol:float形,默认值= 1e-4,与inertia结合来确定收敛条件; #(6)n_jobs:指定计算所用的进程数; #(7)verbose 参数设定打印求解过程的程度,值越大,细节打印越多; #(8)copy_x:布尔型,默认值=True。当我们precomputing distances时,将数据中心化会得到更准确的结果。如果把此参数值设为True,则原始数据不会被改变。如果是False,则会直接在原始数据上做修改并在函数返回值时将其还原。但是在计算过程中由于有对数据均值的加减运算,所以数据返回后,原始数据和计算前可能会有细小差别。 #属性: #(1)cluster_centers_:向量,[n_clusters, n_features] # Coordinates of cluster centers (每个簇中心的坐标??); #(2)Labels_:每个点的分类; #(3)inertia_:float,每个点到其簇的质心的距离之和。

2018-01-26

2019蓝桥杯.zip

2019年蓝桥杯B组省赛C/C++试题,包括PDF文件、A-J题全部试题的图片、数据等。试题解析可以参考:https://blog.csdn.net/zhaohaibo_/article/details/88783978

2019-11-12

2015年数模国赛b题数据

包含北京、西安、南京、成都四个城市2016年8月6日-12日每日0点-12点内的demand(打车需求量) distribute(出租车分布) money(车费) response(被抢单时间) satisfy(打车难易度) 五种信息

2018-08-26

ACM校赛题解.pptx

ACM校赛

2019-10-26

Iovebecky的留言板

发表于 2020-01-02 最后回复 2020-01-02

考研 计算机和软件工程差别很大吗?

发表于 2019-09-10 最后回复 2019-09-10

空空如也

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

TA关注的人 TA的粉丝

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