自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(251)
  • 资源 (3)
  • 收藏
  • 关注

原创 Windows下安装Scrapy和lxml

最近学习Python爬虫,看的是 《Python网络数据采集》。第三章介绍了Scrapy库,因此需要安装这个库。关于这个库的功能本文不做阐述。环境Windows版本:Windows 10 64 bitPython版本:3.5.2、32位概要因为Scrapy库的安装需要一些依赖库,具体可以看这里:https://doc.scrapy.org/en/latest

2016-12-09 16:53:37 1622

原创 分组背包问题:不超过N元钱

https://nanti.jisuanke.com/t/256金明今天很开心,家里购置的新房就要领钥匙了,新房里有一间金明自己专用的很宽敞的房间。更让他高兴的是,妈妈昨天对他说:“你的房间需要购买哪些物品,怎么布置,你说了算,只要不超过N元钱就行”。今天一早,金明就开始做预算了,他把想买的物品分为两类:主件与附件,附件是从属于某个主件的,下表就是一些主件与附件的例子: 主件 附件 电

2016-08-29 16:52:52 1404

原创 出栈序列与卡特兰数

给定一个入栈序列,求出所有可能的出栈序列#include #include #include #include using namespace std;stack stackOut, stackIn;vector> res;int n;int total = 0;vector vec;void out(){ sort(res.begin(), res.end());

2016-08-19 20:34:00 869

原创 BFS 闯迷宫

题目描述:sun所在学校每年都要举行电脑节,今年电脑节有一个新的趣味比赛项目叫做闯迷宫。sun的室友在帮电脑节设计迷宫,所以室友就请sun帮忙计算下走出迷宫的最少步数。知道了最少步数就可以辅助控制比赛难度以及去掉一些没有路径到达终点的map。比赛规则是:从原点(0,0)开始走到终点(n-1,n-1),只能上下左右4个方向走,只能在给定的矩阵里走。输入:输入有多组数据

2016-08-19 16:08:38 558

原创 hihocoder-#1048 : 状态压缩·二

http://hihocoder.com/problemset/problem/1048?sid=850488#1048 : 状态压缩·二时间限制:10000ms单点时限:1000ms内存限制:256MB描述历经千辛万苦,小Hi和小Ho终于到达了举办美食节的城市!虽然人山人海,但小Hi和小Ho仍然抑制不住兴奋之情,他们放下

2016-08-15 17:13:03 906

原创 hihocoder-#1044 : 状态压缩·一

http://hihocoder.com/problemset/problem/1044?sid=849998#1044 : 状态压缩·一时间限制:10000ms单点时限:1000ms内存限制:256MB描述小Hi和小Ho在兑换到了喜欢的奖品之后,便继续起了他们的美国之行,思来想去,他们决定乘坐火车前往下一座城市——那座城

2016-08-14 21:37:49 995

原创 动态规划之背包问题

最近刷题遇到好几道背包问题,背包问题是动态规则中的一类体型,在考察算法的笔试中经常遇到。关于背包问题,文章 背包问题九讲 中已经做了很多分析,这里就不再细述,建议好好看看这篇文章。然而文章给了许多案例分析,却没有很好的练习。说明:1、本文目的不在于讲解背包问题的分析与讲解,而是收集了一些背包问题。希望学习者学习背包问题的时候能找到一些对应的题加以练习。2、本文根据我是刷题中遇到

2016-08-11 20:06:42 940

原创 LeetCode-374&375.Guess Number Higher or Lower

https://leetcode.com/problems/guess-number-higher-or-lower/We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.

2016-08-08 22:04:35 508

原创 LeetCode-115.Distinct Subsequences

https://leetcode.com/problems/distinct-subsequences/Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is fo

2016-08-08 21:53:55 557

原创 LeetCode-97.Interleaving String

https://leetcode.com/problems/interleaving-string/Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 =

2016-08-08 16:29:50 375

原创 LeetCode-68.Text Justification

https://leetcode.com/problems/text-justification/Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.

2016-08-08 14:50:48 752

原创 微软苏州校招笔试(2016.12):#1091 : Clicker

http://hihocoder.com/problemset/problem/1091#1091 : Clicker时间限制:10000ms单点时限:1000ms内存限制:256MB描述Little Ho is obsessed with a computer game called "Clicker". In this

2016-08-08 13:47:48 1556

原创 LeetCode-174.Dungeon Game

https://leetcode.com/problems/dungeon-game/The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a

2016-07-22 11:22:21 406

原创 微软2016校园招聘:#1239 : Fibonacci

http://hihocoder.com/problemset/problem/1239?sid=822524#1239 : Fibonacci时间限制:10000ms单点时限:1000ms内存限制:256MB描述Given a sequence {an}, how many non-empty sub-sequence

2016-07-20 11:30:39 474

原创 华为2016校园招聘:简单错误记录

http://www.nowcoder.com/questionTerminal/67df1d7889cf4c529576383c2e647c48[编程题]简单错误记录开发一个简单错误记录功能小模块,能够记录出错的代码所在的文件名称和行号。 处理:1.记录最多8条错误记录,对相同的错误记录(即文件名称和行号完全匹配)只记录一条,错误计数增加;(文件所在的目录不同,文

2016-07-20 11:00:15 614

原创 LeetCode-33.Search in Rotated Sorted Array

https://leetcode.com/problems/search-in-rotated-sorted-array/Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).

2016-07-18 22:38:20 371

原创 2016微软探星夏令营:#1341 : Constraint Checker

http://hihocoder.com/problemset/problem/1341?sid=827699#1341 : Constraint Checker时间限制:10000ms单点时限:1000ms内存限制:256MB描述Given a set of constraints like 0NM and values

2016-07-18 20:12:06 1572 1

原创 hihocoder-#1338 : A Game

http://hihocoder.com/problemset/problem/1338?sid=827401#1338 : A Game时间限制:10000ms单点时限:1000ms内存限制:256MB描述Little Hi and Little Ho are playing a game. There is an in

2016-07-18 17:15:28 667

原创 LeetCode-336.Palindrome Pairs

https://leetcode.com/problems/palindrome-pairs/Given a list of unique words. Find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e.words[

2016-07-16 21:24:50 1287

原创 LeetCode-211.Add and Search Word - Data structure design

https://leetcode.com/problems/add-and-search-word-data-structure-design/Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(word)

2016-07-16 14:23:34 408

原创 LeetCode-208.Implement Trie (Prefix Tree)

https://leetcode.com/problems/implement-trie-prefix-tree/Implement a trie with insert, search, and startsWith methods.Note:You may assume that all inputs are consist of lowercase letters

2016-07-16 12:46:48 375

原创 LeetCode-179.Largest Number

https://leetcode.com/problems/largest-number/Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest form

2016-07-14 12:58:59 347

原创 LeetCode-233.Number of Digit One

https://leetcode.com/problems/number-of-digit-one/Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Given n =

2016-07-12 15:54:14 418

原创 剑指Offer-面试题27:二叉搜索树与双向链表

题面:《剑指Offer》P151 / 牛客网输入一棵二叉搜索树,将该二叉搜索树转换成一个排序的双向链表。要求不能创建任何新的结点,只能调整树中结点指针的指向。如如果不考虑箭头,可以看到4 6 8 10 12 14 16是树的中序遍历因此可以借用中序遍历的方法进行修改/*struct TreeNode { int val; struct TreeNode *le

2016-07-06 21:29:11 424

原创 LeetCode-138.Copy List with Random Pointer

题面:《剑指Offer》P147 / 复杂链表的复制输入一个复杂链表(每个节点中有节点值,以及两个指针,一个指向下一个节点,另一个特殊指针指向任意一个节点)先忽略random结点,复制原始链表,并将每个新复制的节点

2016-07-02 21:05:52 413

原创 剑指Offer-面试题22:栈的压入、弹出序列

题面:《剑指Offer》P134 / 牛客网输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否为该栈的弹出顺序。假设压入栈的所有数字均不相等。例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压栈序列对应的一个弹出序列,但4,3,5,1,2就不可能是该压栈序列的弹出序列。分析清楚两个序列的关系问题就能迎刃而解方法1第一个弹出栈的位置无

2016-06-30 18:46:38 821

原创 微软2016校园招聘4月:hihocoder- #1290 : Demo Day

http://hihocoder.com/problemset/problem/1290?sid=811882#1290 : Demo Day时间限制:10000ms单点时限:1000ms内存限制:256MB描述You work as an intern at a robotics startup. Today i

2016-06-29 20:41:24 516

原创 LeetCode-130.Surrounded Regions

https://leetcode.com/problems/surrounded-regions/Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in tha

2016-06-28 15:43:46 409

原创 剑指Offer-面试题12:打印1到最大的n位数

题面:输入数字n,按顺序打印出从1到最大的n位十进制数。比如n=3,则打印输出1,2,3....999如果n比较小,可以很容易得到下面的代码void Print1ToMaxOfNDigits(int n){ int i = 0,max = 1; while (i++ < n) max *= 10; for (i = 1; i < max; i++)}但是当n比

2016-06-27 13:55:31 405

原创 LeetCode-106.Construct Binary Tree from Inorder and Postorder Traversal

https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that

2016-06-26 22:03:23 324

原创 LeetCode-105.Construct Binary Tree from Preorder and Inorder Traversal

https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that d

2016-06-26 21:48:00 362

原创 LeetCode-50.Pow(x, n)

https://leetcode.com/problems/powx-n/Implement pow(x, n).必须考虑各种越界问题参考 http://blog.csdn.net/linhuanmars/article/details/20092829#define DBL_MAX 1.7976931348623158e+308class Solution {publi

2016-06-26 16:14:58 389

原创 腾讯2017暑期实习生编程题-字符移位

测试链接 http://www.nowcoder.com/profile/8851694/test/3538973/44803小Q最近遇到了一个难题:把一个字符串的大写字母放到字符串的后面,各个字符的相对位置不变,且不能申请额外的空间。你能帮帮小Q吗?输入描述:输入数据有多组,每组包含一个字符串s,且保证:1<=s.length<=1000.

2016-06-22 20:52:34 1340

原创 腾讯2017暑期实习生编程题-构造回文

测试链接 http://www.nowcoder.com/questionTerminal/28c1dc06bc9b4afd957b01acdf046e69给定一个字符串s,你可以从中删除一些字符,使得剩下的串是一个回文串。如何删除才能使得回文串最长呢?输出需要删除的字符个数。输入描述:输入数据有多组,每组包含一个字符串s,且保证:1<=s.length<=1000.

2016-06-22 20:47:43 1599

原创 百度2017暑期实习生编程题-页面调度算法

测试链接 http://www.nowcoder.com/question/next?pid=1725826&qid=44807&tid=3554159在计算机中,页式虚拟存储器实现的一个难点是设计页面调度(置换)算法。其中一种实现方式是FIFO算法。FIFO算法根据页面进入内存的时间先后选择淘汰页面,先进入内存的页面先淘汰,后进入内存的后淘汰。假设Cache的大小为2,有5个

2016-06-22 12:32:33 765

原创 二叉搜索树(BST)的创建、插入、查找和删除

树的结构体定义struct TreeNode{ int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {}};插入因为二叉搜索树不允许存在相等的值,所以插入有可能失败非递归版bool BSTInsert(TreeNode* &root

2016-06-21 15:48:49 9585 2

原创 LeetCode-338.Counting Bits

https://leetcode.com/problems/counting-bits/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

2016-06-20 15:54:23 252

原创 LeetCode-187.Repeated DNA Sequences

https://leetcode.com/problems/repeated-dna-sequences/All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes u

2016-06-19 22:35:10 355

原创 LeetCode-343.Integer Break

https://leetcode.com/problems/integer-break/Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum pro

2016-06-19 15:34:59 266

原创 LeetCode-41.First Missing Positive

https://leetcode.com/problems/first-missing-positive/Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.

2016-06-18 22:52:35 330

JPEG压缩神器

【摄友Hold住!JPEG压缩神器】以色列科技公司ICTV开发出的一种能够优化JPEG压缩的方法。软件自动分析一张照片在对画质不产生可见损失前提下可用的最大压缩率。ICTV称该方法预计可以将照片体积缩小50%-80%。

2014-12-16

WP8 下载网络音频到独立存储空间中播放示例

代码详解: http://blog.csdn.net/zmq570235977/article/details/20702729

2014-03-07

PDFEdit编辑器

推荐一个很好用的PDF编辑器程序可以帮助您有效地编辑PDF文件!它是世界上最好的和最好用的PDF编辑软件,很容易的即时编辑PDF文件。现在,您可以有效地使用的PDF编辑器程序以你自己的意愿读取和写入PDF格式文本,内容,图片,图片。 但是网上的版本打开时会有未注册的对话框,并且编辑过后的PDF文档每一页的右上角会带上"由Foxit PDF Editor 编辑 版权所有(c) by Foxit Software Company,2003-2009 仅用于评估"的红色标记. 这是我修改后的版本,去掉了未注册的对话框和标记

2012-10-06

空空如也

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

TA关注的人

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