- 博客(153)
- 收藏
- 关注

原创 Scrapy获取网易云音乐歌手全部歌曲(excel存取)
前言:这个爬虫是为了之后爬取10W以上评论的歌曲做一下准备,这次以网易云音乐中的林俊杰为实验例子爬虫思路:爬取思路上,需要先通过歌手的所有专辑页面,获取到歌手的每个专辑的id,通过专辑的id转到专辑的界面,在专辑中获取歌曲id,转到歌曲界面后,我们就可以抓取歌曲上的信息了,不包括评论数,评论数是在另外的页面爬虫过程:首先展示一下爬虫的item部分class WangyimusictestItem(...
2018-02-16 20:20:48
2839

原创 python爬虫豆瓣近几年的国产好作品
本来是想爬国产电影,但是发现好像不太行,我是按照年份,结果里面什么都有这就比较尴尬了import requestsimport stringfrom bs4 import BeautifulSoupimport pandasimport timeimport numpy as npimport xlsxwriterimport removie_select=[]#修改请求头文
2017-02-17 19:28:34
798
原创 Codeforces Round #465 (Div. 2) C. Fifa and Fafa(圆问题,数论)
C. Fifa and Fafatime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFifa and Fafa are sharing a flat. Fifa loves video games and wants to download a ne...
2018-02-20 16:16:48
642
原创 爬虫爬取音悦台mv排行榜(包括使用代理ip,修改请求头)
此爬虫基于BeautifulSoup4为基础情况下,模仿scrapy的结构进行编码在代码里增添了两个额外的py代码第一个是resource,里面包涵请求头和代理ip,其中的代理ip可以从西刺代理中爬虫获取UserAgents =[ 'Mozilla/5.0 (Linux; Android 4.1.1; Nexus 7 Build/JRO03D) AppleWebKit/535.19 (KH...
2018-02-12 13:10:58
6150
原创 HDU 1011(树形DP)
Starship TroopersTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21216 Accepted Submission(s): 5652Problem DescriptionYou, the leader of Sta...
2018-02-10 19:34:39
344
转载 数位DP
基础篇数位dp是一种计数用的dp,一般就是要统计一个区间[le,ri]内满足一些条件数的个数。所谓数位dp,字面意思就是在数位上进行dp咯。数位还算是比较好听的名字,数位的含义:一个数有个位、十位、百位、千位......数的每一位就是数位啦!之所以要引入数位的概念完全就是为了dp。数位dp的实质就是换一种暴力枚举的方式,使得新的枚举方式满足dp的性质,然后记忆化就可以了。
2018-02-07 17:36:24
195
原创 HDU2639 Bone Collector II(01背包变形)
级第42届ACM国际大学生程序设计竞赛全球总决赛Bone Collector IITime Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5490 Accepted Submission(s): 2901
2018-02-05 15:17:36
160
原创 Codeforces Round #456 (Div. 2)B. New Year's Eve(位运算)
B. New Year's Evetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSince Grisha behaved well last year, at Ne
2018-02-05 13:49:29
160
转载 Pycharm中的scrapy安装教程
原文链接: 点击打开链接在利用pycharm安装scrapy包是遇到了挺多的问题。在折腾了差不多折腾了两个小时之后总算是安装好了。期间各种谷歌和百度,发现所有的教程都是利用命令行窗口安装的。发现安装scrapy需要的包真是多的要死啊。没有专门针对pycharm安装的。因此这里将自己的安装经验分享一下,希望能帮助一些pythoner少走一些弯路(废话到此为止,下面正题。。) 首先呢
2018-01-24 17:51:29
649
原创 Codeforces Round #442 (Div. 2)B. Nikita and string(字符串,贪心)
B. Nikita and stringtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Nikita found the string contai
2018-01-23 18:21:15
243
原创 Educational Codeforces Round 34 (Rated for Div. 2)D. Almost Difference(数学)
D. Almost Differencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet's denote a functionYou are
2018-01-22 21:48:39
219
原创 Educational Codeforces Round 34 (Rated for Div. 2)B. The Modcrab(贪心)
B. The Modcrabtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVova is again playing some computer game, now
2018-01-22 21:44:49
195
原创 Codeforces Round #451 (Div. 2)D. Alarm Clock(贪心)
D. Alarm Clocktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEvery evening Vitalya sets n alarm clocks to
2018-01-22 21:40:22
201
原创 抓取股票当日信息
股票代码来源东方财富网,详细信息来自QQ股票import requestsfrom bs4 import BeautifulSoupimport reimport tracebackimport timeimport numpy as np#修改请求头文件,避免封IPhds=[{'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT
2017-12-11 16:36:22
958
2
原创 抓取淘宝某类商品名称和价格
import requestsimport reimport timedef getHTMLText(url): try: r = requests.get(url, timeout = 30)#设定超时时间 r.raise_for_status() r.encoding = r.apparent_encoding
2017-11-27 22:33:21
5409
原创 Water Tree CodeForces - 343D(dfs序列+线段树 模板)
D. Water Treetime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMad scientist Mike has constructed a rooted t
2017-10-20 21:55:02
386
原创 HDU - 3966 Aragorn's Story(树链剖分点权模板题)
Aragorn's StoryTime Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 13639 Accepted Submission(s): 3632Problem DescriptionOur protagon
2017-10-12 21:01:59
273
原创 Codeforces Round #401 (Div. 2) D. Cloud of Hashtags
D. Cloud of Hashtagstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya is an administrator of a public
2017-10-09 22:39:09
223
原创 POJ1273 Drainage Ditches(网络流最大流模板)
Drainage DitchesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 78164 Accepted: 30497DescriptionEvery time it rains on Farmer John's fields, a pond form
2017-09-21 21:54:38
265
原创 The Unique MST POJ - 1679 (次小生成树模板)
The Unique MSTTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 32148 Accepted: 11633DescriptionGiven a connected undirected graph, tell if its minimum sp
2017-09-21 21:45:37
264
原创 POJ - 2449 Remmarguts' Date(k短路模板)
Remmarguts' DateTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 31470 Accepted: 8580Description"Good man never makes girls wait or breaks an appointment
2017-09-21 21:24:29
274
原创 Roads in the North POJ - 2631(树的直径)
Roads in the NorthTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2992 Accepted: 1477DescriptionBuilding and maintaining roads among communities in the
2017-09-15 21:10:40
256
原创 Tallest Cow POJ - 3263(线段树区间修改,单点查询)
Tallest CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 2388 Accepted: 1094DescriptionFJ's N (1 ≤ N ≤ 10,000) cows conveniently indexed 1..N are stan
2017-09-15 21:04:48
252
原创 transaction transaction transaction HDU - 6201(dfs)
transaction transaction transactionTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others)Total Submission(s): 1542 Accepted Submission(s): 745Problem Descri
2017-09-15 20:57:54
258
原创 Network of Schools POJ1236(tarjan缩点+强连通分量模板)
Network of SchoolsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 19564 Accepted: 7705DescriptionA number of schools are connected to a computer network
2017-09-13 11:26:57
325
原创 POJ3273Monthly Expense(二分)
Monthly ExpenseTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 29158 Accepted: 11077DescriptionFarmer John is an astounding accounting wizard and has re
2017-09-08 23:14:14
219
原创 Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) C. Planning(并查集)
C. Planningtime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputHelen works in Metropolis airport. She is respon
2017-09-08 16:16:07
301
原创 Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) D. Jury Meeting(贪心)
D. Jury Meetingtime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputCountry of Metropolia is holding Olympiad of
2017-09-08 16:06:27
445
原创 A Simple Problem with Integers POJ - 3468 (线段树区间增减,区间查询模板)
A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 117870 Accepted: 36662Case Time Limit: 2000MSDescriptionYou have N
2017-08-31 18:38:43
193
原创 Just a Hook HDU - 1698(线段树区间更换,区间询问模板)
Just a HookTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 35101 Accepted Submission(s): 17147Problem DescriptionIn the game of D
2017-08-31 17:35:54
220
原创 I Hate It HDU - 1754(线段树单点修改,区间求最大值模板)
I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 82848 Accepted Submission(s): 31840Problem Description很多学校流行一种比较的习惯。老师们很
2017-08-30 18:55:24
267
原创 敌兵布阵 HDU - 1166 (线段树单点修改区间求和模板)
敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 98863 Accepted Submission(s): 41878Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以
2017-08-30 18:12:42
261
原创 Codeforces Round #430 (Div. 2) B. Gleb And Pizza(数论)
B. Gleb And Pizzatime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGleb ordered pizza home. When the courier
2017-08-30 12:34:13
608
原创 Codeforces Round #430 (Div. 2) C. Ilya And The Tree(dfs+最大公约数+因子+树)
C. Ilya And The Treetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIlya is very fond of graphs, especiall
2017-08-30 12:27:04
871
原创 Codeforces Round #383 (Div. 2) C. Arpa's loud Owf and Mehrdad's evil plan
C. Arpa's loud Owf and Mehrdad's evil plantime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs you have notic
2017-08-23 19:01:27
253
原创 Codeforces Round #383 (Div. 2) D. Arpa's weak amphitheater and Mehrdad's valuable Hoses(并查集+分组背包)
D. Arpa's weak amphitheater and Mehrdad's valuable Hosestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputJus
2017-08-23 18:51:15
274
原创 2017 Multi-University Training Contest - Team 9 E - FFF at Valentine
FFF at ValentineTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 86 Accepted Submission(s): 37Problem DescriptionAt Valentin
2017-08-22 18:12:55
644
原创 2017 Multi-University Training Contest - Team 9 Numbers (实力乱搞)
NumbersTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 61 Accepted Submission(s): 25Problem Descriptionzk has n numbers a1,a2,.
2017-08-22 18:08:16
401
原创 HDU - 2665 Kth number(划分树模板题)
Kth numberTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12101 Accepted Submission(s): 3692Problem DescriptionGive you a sequen
2017-08-20 18:15:06
250
原创 Battleship
这次是用python写的一个小游戏,简单无比,还是可以当作入门去搞得,里面包含了使用随机和生成二维数组循环一些基础东西from random import randint#导入随机board = []for x in range(0, 5): board.append(["O"] * 5)#生成一个5*5的二维数组def print_board(board): for r
2017-08-17 19:44:58
715
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人