自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(38)
  • 资源 (17)
  • 收藏
  • 关注

原创 hiho一下 更为复杂的买卖房屋姿势(线段树)

时间限制:10000ms单点时限:1000ms内存限制:256MB描述小Hi和小Ho都是游戏迷,“模拟都市”是他们非常喜欢的一个游戏,在这个游戏里面他们可以化身上帝模式,买卖房产。在这个游戏里,会不断的发生如下两种事件:一种是房屋自发的涨价或者降价,而另一种是政府有关部门针对房价的硬性调控。房价的变化自然影响到小Hi和小Ho的决策,所以他们希望能够知道任

2015-08-26 14:28:02 654

原创 poj 3468 A Simple Problem with Integers(线段树-区间更新(基础))

A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 78715 Accepted: 24261Case Time Limit: 2000MSDescriptionYou have N

2015-08-26 12:09:58 504

原创 hiho一下 微软笔试题《String Matching Content Length》

时间限制:10000ms单点时限:1000ms内存限制:256MB描述We define the matching contents in the strings of strA and strB as common substrings of the two strings. There are two additional restrictions on

2015-08-25 17:17:15 1370 1

原创 poj 1376 Robot(bfs)

RobotTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 6813 Accepted: 2221DescriptionThe Robot Moving Institute is using a robot in their local store to

2015-08-25 14:33:12 616

原创 hdu 4090 GemAnd Prince(dfs)

GemAnd PrinceProblem DescriptionNowadays princess Claire wants one more guard and posts the ads throughout the kingdom. For her unparalleled beauty, generality, goodness and other virtues,

2015-08-25 10:41:50 511

原创 poj 1475 Pushing Boxes(bfs)

Pushing BoxesTime Limit: 2000MS Memory Limit: 131072KTotal Submissions: 4846 Accepted: 1671 Special JudgeDescriptionImagine you are standing inside a two-di

2015-08-24 19:57:13 657

原创 hdu 1732 Push Box(bfs)

Problem DescriptionPush Box is a classic puzzle game. This game play in a grid, there are five types of block in it, the player, the box, the hole, empty place, and the wall. In every step, player

2015-08-24 16:21:11 535

原创 poj 1324 Holedox Moving(bfs+状态压缩)

DescriptionDuring winter, the most hungry and severe time, Holedox sleeps in its lair. When spring comes, Holedox wakes up, moves to the exit of its lair, comes out, and begins its new life. Hol

2015-08-24 10:53:29 471

原创 hdu 1190 生日蛋糕(dfs+剪枝)

Description7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体。 设从下往上数第i(1 Ri+1且Hi > Hi+1。 由于要在蛋糕上抹奶油,为尽可能节约经费,我们希望蛋糕外表面(最下一层的下底面除外)的面积Q最小。 令Q = Sπ 请编程对给出的N和M,找出蛋糕的制作方案(适当的Ri和Hi的值),使S最小。

2015-08-15 21:49:09 618

原创 hdu 2437 Jerboas(bfs,dfs)

Problem Description      Jerboas are small desert-living animals, which resemble mice with a long tufted tail and very long hind legs. Jerboas shelter in well-hidden burrows. They create two types

2015-08-15 14:49:49 473

原创 hdu 3295 An interesting mobile game(bfs)

Problem DescriptionXQ,one of the three Sailormoon girls,is usually playing mobile games on the class.Her favorite mobile game is called “The Princess In The Wall”.Now she give you a problem about

2015-08-15 10:19:03 964

原创 poj 3750 小孩报数问题(线段树-单点更新)

Description有N个小孩围成一圈,给他们从1开始依次编号,现指定从第W个开始报数,报到第S个时,该小孩出列,然后从下一个小孩开始报数,仍是报到S个出列,如此重复下去,直到所有的小孩都出列(总人数不足S个时将循环报数),求小孩出列的顺序。Input第一行输入小孩的人数N(N接下来每行输入一个小孩的名字(人名不超过15个字符) 最后一行输入W,S (W Outp

2015-08-13 17:45:03 562

原创 poj 2886 Who Gets the Most Candies?(线段树-单点更新)

DescriptionN children are sitting in a circle to play a game.The children are numbered from 1 to N in clockwise order. Each of them has a card with a non-zero integer on it in his/her hand. The

2015-08-13 16:37:27 496

原创 poj 2828 Buy Tickets(线段树-单点更新)

DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the Little Ca

2015-08-12 21:33:29 444

原创 hdu 3085 Nightmare Ⅱ(双向bfs)

Problem DescriptionLast night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were trapped in a big maze separately. More terribly, there are two ghosts in the maz

2015-08-12 17:05:43 933 2

原创 hdu 1195 Open the Lock(基础bfs)

Problem DescriptionNow an emergent task for you is to open a password lock. The password is consisted of four digits. Each digit is numbered from 1 to 9. Each time, you can add or minus 1 to any

2015-08-12 11:04:55 409

原创 hdu 3309 Roll The Cube(bfs)

Problem DescriptionThis is a simple game.The goal of the game is to roll two balls to two holes each.'B' -- ball'H' -- hole'.' -- land'*' -- wallRemember when a ball rolls into a hole, t

2015-08-11 23:46:12 611

原创 hdu 2203 亲和串(kmp)

Problem Description人随着岁数的增长是越大越聪明还是越大越笨,这是一个值得全世界科学家思考的问题,同样的问题Eddy也一直在思考,因为他在很小的时候就知道亲和串如何判断了,但是发现,现在长大了却不知道怎么去判断亲和串了,于是他只好又再一次来请教聪明且乐于助人的你来解决这个问题。亲和串的定义是这样的:给定两个字符串s1和s2,如果能通过s1循环移位,使s2包含在s1中,

2015-08-11 17:38:06 555

原创 hdu 1277 全文检索(ac自动机模板)

Problem Description我们大家经常用google检索信息,但是检索信息的程序是很困难编写的;现在请你编写一个简单的全文检索程序。问题的描述是这样的:给定一个信息流文件,信息完全有数字组成,数字个数不超过60000个,但也不少于60个;再给定一个关键字集合,其中关键字个数不超过10000个,每个关键字的信息数字不超过60个,但也不少于5个;两个不同的关键字的前4个数字是不

2015-08-11 14:22:17 609

原创 hdu 1358 Period(kmp)

Problem DescriptionFor each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string.

2015-08-11 10:51:39 404

原创 hdu 3746 Cyclic Nacklace(kmp)

Problem DescriptionCC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed an

2015-08-10 20:04:11 424

原创 hdu 4101 Ali and Baba(bfs,dfs)

Problem DescriptionThere is a rectangle area (with N rows and M columns) in front of Ali and Baba, each grid might be one of the following:1. Empty area, represented by an integer 0.2. A Stone

2015-08-10 16:16:15 532

原创 hdu 3336 Count the string(kmp应用)

Problem DescriptionIt is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string.

2015-08-06 19:16:11 944

原创 hdu 1686 Oulipo(kmp)

Problem DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait

2015-08-06 14:55:26 392

原创 hdu 1711 Number Sequence(kmp模板题)

Problem DescriptionGiven two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] =

2015-08-06 10:40:11 408

原创 hdu 2087 剪花布条(kmp模板)

Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢? Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过

2015-08-06 10:10:01 643

原创 hdu 1664 Different Digits(bfs+余数判重)

Problem DescriptionGiven a positive integer n, your task is to find a positive integer m, which is a multiple of n, and that m contains the least number of different digits when represented in dec

2015-08-05 23:06:05 644

原创 hdu 2102 A计划(bfs)

Problem Description可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。现据密探所报,公主被关在一个两层的迷宫里,迷宫的入口是S(0,0,0),公主

2015-08-05 13:44:33 562

原创 hdu1226 超级密码(bfs+余数判重)

Problem DescriptionIgnatius花了一个星期的时间终于找到了传说中的宝藏,宝藏被放在一个房间里,房间的门用密码锁起来了,在门旁边的墙上有一些关于密码的提示信息:密码是一个C进制的数,并且只能由给定的M个数字构成,同时密码是一个给定十进制整数N(0注意:由于宝藏的历史久远,当时的系统最多只能保存500位密码.因此如果得到的密码长度大于500也不能用来开启房门

2015-08-05 10:39:52 586

原创 hdu 1429 胜利大逃亡(续)(状态压缩+bfs)

Problem DescriptionIgnatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)……这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安装了带锁的门,钥匙藏在地牢另外的某些地方。刚开始Ignatius被关在(sx,sy)的位置,离开地牢的门在(ex,ey)的位置。Ignatius每分钟只能从一个坐标走到相邻四个坐标中的其中一个。

2015-08-04 14:36:27 694

原创 hdu 1885 Key Task(状态压缩+bfs)

Problem DescriptionThe Czech Technical University is rather old — you already know that it celebrates 300 years of its existence in 2007. Some of the university buildings are old as well. And the

2015-08-04 13:03:36 415

原创 hdu 2795 Billboard(线段树-单点更新)

Problem DescriptionAt the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible announcement

2015-08-04 09:52:22 436

原创 hdu 1394 Minimum Inversion Number(线段树-单点更新)

Problem DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i aj.For a given sequence of numbers a1, a2, ..., an, if we mov

2015-08-03 13:59:19 411

原创 hdu 1166 敌兵布阵(线段树入门-单点更新)

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

2015-08-03 10:46:20 428

原创 hdu 1754 I Hate It(线段树入门-单点更新)

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

2015-08-02 22:52:31 502

原创 poj 2631 Roads in the North(裸树的直径)

DescriptionBuilding and maintaining roads among communities in the far North is an expensive business. With this in mind, the roads are build such that there is only one route from a village to a

2015-08-01 22:02:08 660

原创 hdu 1176免费馅饼(二维dp)

Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中

2015-08-01 21:56:52 425

原创 zoj 3430 Detect the Virus(ac自动机)

Detect the VirusTime Limit:2 Seconds Memory Limit:65536 KBOne day, Nobita found that his computer is extremely slow. After several hours' work, he finally found that it was a virus...

2015-08-01 10:40:12 717 1

UNIX环境高级编程第二版

UNIX环境高级编程第二版

2015-10-15

TCP-IP详解卷3:TCP事务协议,HTTP,NNTP和UNIX域协议

TCP-IP详解卷3:TCP事务协议,HTTP,NNTP和UNIX域协议

2015-10-15

TCP-IP详解卷1:协议

TCP-IP详解卷1:协议,网络协议通常分不同层次进行开发,每一层分别 负责不同的通信功能。一个协议族,比如 TCP/IP,是 一组不同层次上的多个协议的组合。 TCP/IP通常被认 为是一个四层协议系统

2015-10-15

nasm中文手册

NASM是一个为可移植性与模块化而设计的一个80x86的汇编器。它支持相当多的目标 文件格式,包括 Linux 和"NetBSD/FreeBSD","a.out","ELF","COFF",微软 16 位的"OBJ"和 "Win32"。它还可以输出纯二进制文件。它的语法设计得相当的简洁易懂,和 Intel 语法相似 但更简单。它支持"Pentium","P6","MMX","3DNow!","SSE" and "SSE2"指令集,

2015-03-12

线段树专辑

ACM大牛总结的线段树专辑_超经典的

2014-11-11

STL源码剖析简体中文完整版清晰

学习编程的人都知道,阅读、剖析名家代码乃是提高水平的捷径。源码之前,了无秘密。大师们的缜密思维、经验结晶、技术思路、独到风格,都原原本本体现在源码之中。在你仔细推敲之中,迷惑不解之时,恍然大悟之际,你的经验、思维、视野、知识乃至技术品位都会获得快速的成长。 本书所呈现的源码,使你踏上了基度山岛。源码之前了无秘密,你将看到vector的实现、list的实现、heap的实现、deque的实现、Red Black tree的实现、hash table的实现、set/map的实现;你将看到各种算法(排序、查找、排列组合、数据移动与复制技术)的实现;你甚至能够看到底层的memory pook和高阶抽象的traits机制的实现。

2014-11-11

C++标准程序库

C++中的标准程序库是类库和函数的集合,其使用核心语言写成。标准程序库提供若干泛型容器、函数对象、泛型字符串和流(包含交互和文件I/O),支持部分语言特性和常用的函数,如开平方根。C++标准程序库也吸收了ISO C90 C标准程序库。标准程序库的特性声明于std命名空间之中。 标准模板程序库是C++标准程序库的子集,包含容器、算法、迭代器、函数对象等。也有些人使用术语STL代表C++标准程序库。 使用C++标准程序库时,不必加上“.h”。

2014-11-10

ACM培训-动态规划

动态规划算法通常用来解决最优化问题。这些问 题可能存在多个解,每个解具有一个值。我们希 望找到一个具有最优(最大或最小)值的解。在 动态规划算法中,主要关心的是找到一个最优解 和求出最优解的值,而不是找出所有的最优解

2014-11-10

取石子游戏_博弈

一、游戏 游戏A: 1. 甲乙两人面对若干堆石子,其中每一堆石子的数目可以任意确定。例如图 1 所示的初始局面:共 n=3 堆,其中第一堆的石子数 a1=3,第二堆石子数 a2=3, 第三堆石子数 a3=1。两人轮流按下列规则取走一些石子,游戏的规则如下: 2. 每一步应取走至少一枚石子; 3. 每一步只能从某一堆中取走部分或全部石子; � 如果谁无法按规则取子,谁就是输家。 。。。。。。

2014-11-10

空空如也

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

TA关注的人

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