自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

martinue

用脑袋解决一切= =

  • 博客(45)
  • 收藏
  • 关注

原创 hdu1003(简单dp)

Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5

2015-08-30 19:20:20 580

原创 hdu1559(最大子矩阵)

Problem Description给你一个m×n的整数矩阵,在上面找一个x×y的子矩阵,使子矩阵中所有元素的和最大。 Input输入数据的第一行为一个正整数T,表示有T组测试数据。每一组测试数据的第一行为四个正整数m,n,x,y(0 Output对于每组数据,输出一个整数,表示子矩阵的最大和。 Sample I

2015-08-30 18:41:23 953

原创 hdu1428(spfa与记忆化搜索)

漫步校园Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3508    Accepted Submission(s): 1066Problem DescriptionLL最近沉迷于AC不能自拔,每天寝室、机房

2015-08-30 17:43:49 383

原创 poj1459(最大流)

DescriptionA power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amount s(u) >= 0 of power, may produ

2015-08-23 12:28:34 488

原创 poj1273(最大流)

DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to

2015-08-23 12:21:02 567

原创 poj3159(spfa)

DescriptionDuring the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distr

2015-08-20 19:08:41 512

原创 poj1860(bellman ford 算法)

DescriptionSeveral currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations only with these curr

2015-08-20 15:04:26 527

原创 hdu1217(floyd算法)

DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dolla

2015-08-19 22:16:28 458

原创 poj3268(单源最短路,dijkstra算法)

DescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirect

2015-08-19 22:05:14 882

原创 poj1734(floyd算法)

DescriptionThere is a travel agency in Adelton town on Zanzibar island. It has decided to offer its clients, besides many other attractions, sightseeing the town. To earn as much as possible fro

2015-08-19 21:43:59 402

原创 hdu1599(floyd算法讲解)

Description杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在8600需要你帮他找一条这样的路线,并且花费越少越好。  Input第

2015-08-19 21:32:50 1302 2

原创 poj2513(欧拉回路)

DescriptionYou are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of the endpo

2015-08-18 19:47:51 427

原创 hdu1116(欧拉回路)

DescriptionSome of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Because there is no other way to open the doors, the pu

2015-08-18 19:33:44 419

原创 hdu4109(拓扑排序,dp)

DescriptionAli has taken the Computer Organization and Architecture course this term. He learned that there may be dependence between instructions, like WAR (write after read), WAW, RAW. If the

2015-08-18 19:21:53 912

原创 hdu2647(拓扑排序)

DescriptionDandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about how to distribute the rewards. T

2015-08-18 19:17:58 594

原创 hdu2094(水题)

Description有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。 球赛的规则如下: 如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。 如果A打败了B,B又打败了C,而且,C又打败了A,那么A、B、C三者都不可能成为冠军。 根据这个规则,无需循环较量,或许就能确定冠军。你的任务就是面对一群比赛选手,在经过了若干场撕

2015-08-18 19:11:05 1118

原创 hdu1285(图,拓扑排序)

Description有N个比赛队(1 Input输入有若干组,每组中的第一行为二个数N(1 Output给出一个符合要求的排名。输出时队伍号之间有空格,最后一名后面没有空格。 其他说明:符合条件的排名可能不是唯一的,此时要求输出时编号小的队伍在前;输入数据保证是正确的,即输入数据确保一定能有一个符合要求的排名

2015-08-18 19:01:48 500

转载 AC自动机算法详解

说明转载出处:http://www.cppblog.com/mythit/archive/2009/04/21/80633.html感谢大牛的博客!!首先简要介绍一下AC自动机:Aho-Corasick automation,该算法在1975年产生于贝尔实验室,是著名的多模匹配算法之一。一个常见的例子就是给出n个单词,再给出一段包含m个字符的文章,让你找出有多少个单词在文章里出现过。要搞懂

2015-08-13 21:20:39 384

原创 hdu3117(斐波那契数列,矩阵连乘)

DescriptionThe Fibonacci sequence is the sequence of numbers such that every element is equal to the sum of the two previous elements, except for the first two elements f0 and f1 which are respect

2015-08-13 17:06:43 1332

原创 hdu1247(trie树)

DescriptionA hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary. You are to find all the hat’s words in a dictionary.  In

2015-08-12 15:07:43 415

原创 hdu1251(trie树)

DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).  Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分

2015-08-12 14:45:46 601

原创 hdu1075(trie树)

DescriptionIgnatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leaves. Now

2015-08-12 14:36:32 424

原创 hdu1671(trie树(字典树))

DescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers: 1. Emergency 911

2015-08-12 14:28:29 560

原创 hdu1198(并查集的应用)

DescriptionBenny has a spacious farm land to irrigate. The farm land is a rectangle, and is divided into a lot of samll squares. Water pipes are placed in these squares. Different square has a dif

2015-08-10 14:52:12 391

原创 hdu1558(并查集和简单几何的结合)

DescriptionA segment and all segments which are connected with it compose a segment set. The size of a segment set is the number of segments in it. The problem is to find the size of some segment

2015-08-10 14:44:51 345

原创 poj1182(加权值的并查集)

Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说法是"2 X Y",表示X吃Y。 此人对N个

2015-08-10 14:25:49 361

原创 poj2492(加权值的并查集)

DescriptionBackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of

2015-08-10 14:19:56 917

原创 poj1611(并查集)

Description严重急性呼吸系统综合症( SARS), 一种原因不明的非典型性肺炎,从2003年3月中旬开始被认为是全球威胁。为了减少传播给别人的机会, 最好的策略是隔离可能的患者。在Not-Spreading-Your-Sickness大学( NSYSU), 有许多学生团体。同一组的学生经常彼此相通,一个学生可以同时加入几个小组。为了防止非典的传播,NSYSU收集了所有学生团体

2015-08-10 14:06:35 338

原创 hdu1698(线段树区间更新)

Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the sa

2015-08-08 12:02:32 462

原创 poj2828(线段树)

Buy TicketsTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 15869 Accepted: 7905DescriptionRailway tickets were difficult to buy around the Lunar New Y

2015-08-07 17:24:40 363

原创 hdu1372(最爱的广搜)

DescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given set of n square

2015-08-05 20:37:22 403

原创 poj3126(最爱的广搜)

DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. —

2015-08-05 20:33:48 413

原创 poj1426(深搜)

DescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater t

2015-08-05 20:26:52 569

原创 poj1321(深搜)

Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及

2015-08-05 20:23:17 380

原创 fzu1752(坑!!!)

DescriptionGiven A,B,C, You should quickly calculate the result of A^B mod C. (1InputThere are multiply testcases. Each testcase, there is one line contains three integers A, B and C

2015-08-05 20:17:52 665

原创 hdu2421(数学题)

DescriptionXiaoming has just come up with a new way for encryption, by calculating the key from a publicly viewable number in the following way: Let the public key N = A B, where 1 0, a 1, a 2,

2015-08-05 20:12:08 557

原创 uva11237(数学题)

Every year there is the same problem at Halloween: Each neighbour is only willing to give a certaintotal number of sweets on that day, no matter how many children call on him, so it may happen thata

2015-08-05 20:06:43 269

原创 hdu2102(广搜)

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

2015-08-05 19:55:22 697

原创 poj3301(三分)

DescriptionAfter a day trip with his friend Dick, Harry noticed a strange pattern of tiny holes in the door of his SUV. The local American Tire store sells fiberglass patching material only in s

2015-08-04 11:36:16 459

原创 hdu1299(数论题)

DescriptionDiophantus of Alexandria was an egypt mathematician living in Alexandria. He was one of the first mathematicians to study equations where variables were restricted to integral values. I

2015-08-02 10:18:35 665

空空如也

空空如也

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

TA关注的人

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