自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(160)
  • 资源 (4)
  • 收藏
  • 关注

原创 流利阅读 2019.1.31 #10YearChallenge: harmless trend or boon to facial recognition technology?

下载 笔记版/无笔记版 pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总本文内容全部来源于流利阅读。流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。#10YearChallenge: harmless trend or boon to facial recognition technology?#10年...

2019-01-31 11:21:13 1149 4

原创 流利阅读 2019.1.30 China’s Baidu pledges to improve search service after complaint

下载 笔记版/无笔记版 pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总本文内容全部来源于流利阅读。流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。China’s Baidu pledges to improve search service after complaint面临投诉后,中国百度承诺改善搜...

2019-01-30 12:21:49 1134

原创 LeetCode 575. Distribute Candies

题目链接:LeetCode 575Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the corresponding kind. You need t...

2019-01-29 19:53:17 214

原创 流利阅读 2019.1.29 Described as defeated, Islamic State punches back with guerrilla tactics

下载 笔记版/无笔记版 pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总本文内容全部来源于流利阅读。流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。Described as defeated, Islamic State punches back with guerrilla tactics已被击败?“...

2019-01-29 13:03:03 716

原创 【算法竞赛进阶指南】货仓选址

题目描述在一条数轴上有 N 家商店,它们的坐标分别为 A1~AN。现在需要在数轴上建立一家货仓,每天清晨,从货仓到每家商店都要运送一车商品。为了提高效率,求把货仓建在何处,可以使得货仓到每家商店的距离之和最小。输入格式第一行输入整数N。第二行N个整数A1~AN。输出格式输出一个整数,表示距离之和的最小值。数据范围1≤N≤1000001≤N≤1000001≤N≤100000输入...

2019-01-28 18:43:44 1212

原创 【算法竞赛进阶指南】CF670C —— Cinema

题目描述莫斯科正在举办一个大型国际会议,有n个来自不同国家的科学家参会。每个科学家都只懂得一种语言。为了方便起见,我们把世界上的所有语言用1到10910^9109之间的整数编号。在会议结束后,所有的科学家决定一起去看场电影放松一下。他们去的电影院里一共有m部电影正在上映,每部电影的语音和字幕都采用不同的语言。对于观影的科学家来说,如果能听懂电影的语音,他就会很开心;如果能看懂字幕,他就...

2019-01-28 18:19:59 1113 2

原创 LeetCode 463. Island Perimeter

You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water.Grid cells are connected horizontally/vertically (not diagonally). The grid is completely ...

2019-01-28 14:19:07 211

原创 LeetCode 349. Intersection of Two Arrays

https://leetcode.com/problems/intersection-of-two-arrays/Given two arrays, write a function to compute their intersection.Example 1:Input: nums1 = [1,2,2,1], nums2 = [2,2]Output: [2]Example 2:I...

2019-01-28 11:25:26 152

原创 流利阅读 2019.1.28 Tesla doesn’t need to sell cars in China to succeed there

下载 笔记版/无笔记版 pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总本文内容全部来源于流利阅读。流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。Tesla doesn’t need to sell cars in China to succeed there特斯拉不需要在中国销售汽车取得成功Whe...

2019-01-28 10:25:57 1194

原创 剑指offer 51. 字符串中第一个只出现一次的字符

在字符串中找出第一个只出现一次的字符。如输入"abaccdeff",则输出b。如果字符串中不存在只出现一次的字符,返回#字符。样例:输入:"abaccdeff"输出:'b'class Solution {public: char firstNotRepeatingChar(string s) { unordered_map<char, int&gt...

2019-01-27 22:37:12 206

原创 剑指offer 50. 丑数

我们把只包含因子2、3和5的数称作丑数(Ugly Number)。例如6、8都是丑数,但14不是,因为它包含因子7。求第n个丑数的值。样例输入:5输出:5注意:习惯上我们把1当做第一个丑数。class Solution {public:priority_queue<long long, vector<long long>, greater<long lo...

2019-01-27 22:36:58 196

原创 剑指offer 49. 最长不含重复字符的子字符串

请从字符串中找出一个最长的不包含重复字符的子字符串,计算该最长子字符串的长度。假设字符串中只包含从’a’到’z’的字符。样例输入:"abcabc"输出:3class Solution {public: unordered_map<char, int> hash; int longestSubstringWithoutDuplication(string...

2019-01-27 22:36:41 119

原创 剑指offer 48. 礼物的最大价值

在一个m×n的棋盘的每一格都放有一个礼物,每个礼物都有一定的价值(价值大于0)。你可以从棋盘的左上角开始拿格子里的礼物,并每次向右或者向下移动一格直到到达棋盘的右下角。给定一个棋盘及其上面的礼物,请计算你最多能拿到多少价值的礼物?注意:m,n>0样例:输入:[ [2,3,1], [1,7,1], [4,6,1]]输出:19解释:沿着路径 2→3→7→6→1...

2019-01-27 22:35:52 150

原创 剑指offer 47. 把数字翻译成字符串

给定一个数字,我们按照如下规则把它翻译为字符串:0翻译成”a”,1翻译成”b”,……,11翻译成”l”,……,25翻译成”z”。一个数字可能有多个翻译。例如12258有5种不同的翻译,它们分别是”bccfi”、”bwfi”、”bczi”、”mcfi”和”mzi”。请编程实现一个函数用来计算一个数字有多少种不同的翻译方法。样例输入:"12258"输出:5dfsclass Sol...

2019-01-27 22:35:28 214

原创 剑指offer 46. 把数组排成最小的数

输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个。例如输入数组[3, 32, 321],则打印出这3个数字能排成的最小数字321323。样例输入:[3, 32, 321]输出:321323注意:输出数字的格式为字符串。有时间要用Trie做一下啊class Solution {public: vector<string>...

2019-01-27 22:35:04 202

原创 剑指offer 45. 数字序列中某一位的数字

数字以0123456789101112131415…的格式序列化到一个字符序列中。在这个序列中,第5位(从0开始计数)是5,第13位是1,第19位是4,等等。请写一个函数求任意位对应的数字。样例输入:13输出:1class Solution {public: int digitAtIndex(int n) { if(n<=9){ ...

2019-01-27 22:34:39 286

原创 流利阅读 2019.1.27 The death of Venice? City’s battles with tourism and flooding reach crisis level

下载 笔记版/无笔记版 pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总本文内容全部来源于流利阅读。流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。The death of Venice? City’s battles with tourism and flooding reach crisis leve...

2019-01-27 09:37:55 1768 3

原创 LeetCode 172. Factorial Trailing Zeroes

Given an integer n, return the number of trailing zeroes in n!.Example 1:Input: 3Output: 0Explanation: 3! = 6, no trailing zero.Example 2:Input: 5Output: 1Explanation: 5! = 120, one trailing ...

2019-01-26 19:27:19 214 1

原创 LeetCode 219 Contains Duplicate II

Contains Duplicate II - LeetCodeGiven an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the absolute differen...

2019-01-26 16:50:03 190

原创 流利阅读 2019.1.26 The maturing of the smartphone industry should be celebrated, not lamented

下载 笔记版/无笔记版 pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总本文内容全部来源于流利阅读。流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。The maturing of the smartphone industry should be celebrated, not lamented智能手机...

2019-01-26 09:13:13 2307

原创 为什么size()小于-1,size()-1是错的

今天学弟问了这个问题,感觉很有意思为什么下面这句话输出结果是 1 ?vector<int> vec{1,2,3};cout << (vec.size() < -1) << endl;测试了一下发现这样写可以解决这个问题,正确输出结果0vector<int> vec{1,2,3};cout &

2019-01-25 21:23:59 2817 2

原创 HDU 1754 I Hate It 单点改为某数 区间最大值 线段树

Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N 和 M ( 0<N<=200...

2019-01-25 20:37:30 234

原创 流利阅读 2019.1.25 Saudi thirst for water is creating a toxic brine problem

下载 笔记版/无笔记版 pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总本文内容全部来源于流利阅读。流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。Saudi thirst for water is creating a toxic brine problem沙特海水淡化工业引发了毒盐水问题Saudi...

2019-01-25 09:46:10 1337

原创 HDU 1166 敌兵布阵 线段树 单点修改 区间查询

Problem - 1166Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,...

2019-01-24 21:53:19 283

原创 LeetCode 849. Maximize Distance to Closest Person

LeetCode 849In a row of seats, 1 represents a person sitting in that seat, and 0 represents that the seat is empty.There is at least one empty seat, and at least one person sitting.Alex wants to si...

2019-01-24 20:07:42 196

原创 POJ2352 HDU1541 Stars【线段树/树状数组】

http://poj.org/problem?id=2352DescriptionAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an a...

2019-01-24 12:19:13 220 1

原创 流利阅读 2019.1.24 China’s about to rediscover Peppa Pig

下载 笔记版/无笔记版 pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总本文内容全部来源于流利阅读。流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。China’s about to rediscover Peppa Pig中国将重新认识小猪佩奇A promotional clip for a movi...

2019-01-24 09:51:17 1623

原创 LeetCode 121. Best Time to Buy and Sell Stock

LeetCode 121Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of...

2019-01-23 18:42:17 227

原创 流利阅读 2019.1.23 Tech industry expo opens portal to tomorrow

下载 笔记版/无笔记版 pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总本文内容全部来源于流利阅读。流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。Tech industry expo opens portal to tomorrow国际消费电子展——开启通向未来的大门The show must go...

2019-01-23 10:13:55 1356 3

原创 LeetCode 697. Degree of an Array

Degree of an Array - LeetCodeGiven a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements.Your task is to find the s...

2019-01-22 20:12:55 206

原创 流利阅读 2019.1.22 Theresa May loses big over her Brexit deal

下载 笔记版/无笔记版 pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总本文内容全部来源于流利阅读。流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。Theresa May loses big over her Brexit deal特蕾莎·梅在脱欧协议上输大了On January 15th Brita...

2019-01-22 09:05:21 1011

原创 LeetCode 11. Container With Most Water

Container With Most Water - LeetCodeGiven n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i...

2019-01-21 20:19:53 146

原创 【算法竞赛进阶指南】最高的牛

题目描述有 N 头牛站成一行,被编队为1、2、3…N,每头牛的身高都为整数。当且仅当两头牛中间的牛身高都比它们矮时,两头牛方可看到对方。现在,我们只知道其中最高的牛是第 P 头,它的身高是 H ,剩余牛的身高未知。但是,我们还知道这群牛之中存在着 M 对关系,每对关系都指明了某两头牛 A 和 B 可以相互看见。求每头牛的身高的最大可能值是多少。输入格式第一行输入整数N,P,H,M,数...

2019-01-21 19:01:53 3154

原创 【算法竞赛进阶指南】Inc序列

描述给定一个长度为 n 的数列 a1,a2,…,an,每次可以选择一个区间 [l,r],使下标在这个区间内的数都加一或者都减一。求至少需要多少次操作才能使数列中的所有数都一样,并求出在保证最少次数的前提下,最终得到的数列可能有多少种。输入格式第一行输入正整数n。接下来n行,每行输入一个整数,第i+1行的整数代表ai。输出格式第一行输出最少操作次数。第二行输出最终能得到多少种结果。...

2019-01-21 15:41:01 926 1

原创 【算法竞赛进阶指南】激光炸弹 —— 二维前缀和

一种新型的激光炸弹,可以摧毁一个边长为 R 的正方形内的所有的目标。现在地图上有 N 个目标,用整数Xi,Yi表示目标在地图上的位置,每个目标都有一个价值Wi。激光炸弹的投放是通过卫星定位的,但其有一个缺点,就是其爆炸范围,即那个边长为 R 的正方形的边必须和x,y轴平行。若目标位于爆破正方形的边上,该目标不会被摧毁。求一颗炸弹最多能炸掉地图上总价值为多少的目标。输入格式第一行输入正整...

2019-01-21 11:15:05 329

原创 流利阅读 2019.1.21 Top S. Korean animal rights group slammed for destroying dogs

下载 笔记版/无笔记版 pdf资料: GitHub - zhbink/LiuLiYueDu: 流利阅读pdf汇总本文内容全部来源于流利阅读。流利阅读对每期内容均有很好的文章讲解,向您推荐。您可以关注微信公众号:流利阅读 了解详情。Top S. Korean animal rights group slammed for destroying dogs因涉嫌杀狗,韩国最大动物权利组织遭...

2019-01-21 09:30:26 1314

原创 LeetCode 557. Reverse Words in a String III

题目链接Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.Example 1:Input: "Let's take LeetCode contest...

2019-01-20 21:07:20 178

原创 LeetCode 66. Plus One

LeetCode 66. Plus OneGiven a non-empty array of digits representing a non-negative integer, plus one to the integer.The digits are stored such that the most significant digit is at the head of the l...

2019-01-20 20:02:11 114

原创 LeetCode 40. Combination Sum II

Combination Sum II - LeetCodeGiven a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target....

2019-01-20 16:27:40 124

原创 LeetCode 90. Subsets II

Subsets II - LeetCodeGiven a collection of integers that might contain duplicates, nums, return all possible subsets (the power set).Note: The solution set must not contain duplicate subsets.Exampl...

2019-01-20 15:55:03 159

2019蓝桥杯.zip

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

2019-11-12

ACM校赛题解.pptx

ACM校赛

2019-10-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

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

空空如也

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

TA关注的人

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