- 博客(88)
- 资源 (1)
- 收藏
- 关注
原创 2014年百度之星资格赛第四题Labyrinth
Problem Description度度熊是一只喜欢探险的熊,一次偶然落进了一个m*n矩阵的迷宫,该迷宫只能从矩阵左上角第一个方格开始走,只有走到右上角的第一个格子才算走出迷宫,每一次只能走一格,且只能向上向下向右走以前没有走过的格子,每一个格子中都有一些金币(或正或负,有可能遇到强盗拦路抢劫,度度熊身上金币可以为负,需要给强盗写欠条),度度熊刚开始时身上金币数为0,问度度熊走出迷宫时候身上
2014-05-16 19:35:01
1094
1
原创 2014年百度之星资格赛第三题Xor Sum
Problem DescriptionZeus 和 Prometheus 做了一个游戏,Prometheus 给 Zeus 一个集合,集合中包含了N个正整数,随后 Prometheus 将向 Zeus 发起M次询问,每次询问中包含一个正整数 S ,之后 Zeus 需要在集合当中找出一个正整数 K ,使得 K 与 S 的异或结果最大。Prometheus 为了让 Zeus 看到人类的伟大,随即同
2014-05-16 19:33:45
1433
原创 2014年百度之星资格赛第二题Disk Schedule
Problem Description有很多从磁盘读取数据的需求,包括顺序读取、随机读取。为了提高效率,需要人为安排磁盘读取。然而,在现实中,这种做法很复杂。我们考虑一个相对简单的场景。磁盘有许多轨道,每个轨道有许多扇区,用于存储数据。当我们想在特定扇区来读取数据时,磁头需要跳转到特定的轨道、具体扇区进行读取操作。为了简单,我们假设磁头可以在某个轨道顺时针或逆时针匀速旋转,旋转一周的时间是
2014-05-16 19:32:15
1709
原创 2014年百度之星资格赛第一题Energy Conversion
Problem Description 魔法师百小度也有遇到难题的时候—— 现在,百小度正在一个古老的石门面前,石门上有一段古老的魔法文字,读懂这种魔法文字需要耗费大量的能量和大量的脑力。 过了许久,百小度终于读懂魔法文字的含义:石门里面有一个石盘,魔法师需要通过魔法将这个石盘旋转X度,以使上面的刻纹与天相对应,才能打开石门。 但是,旋转石盘需要N点能量值,而为
2014-05-16 19:30:33
1204
原创 编程之美2014年资格赛第三题——格格取数(已过大数据)
题目3 :格格取数时间限制:2000ms单点时限:1000ms内存限制:256MB描述给你一个m x n (1 的矩阵A (0ij,要求在矩阵中选择一些数,要求每一行,每一列都至少选到了一个数,使得选出的数的和尽量的小。 输入多组测试数据。首先是数据组数T对于每组测试数据,第1行是两个正整数m, n,分别表示矩阵的行数和列数。接下来的m行,每行n
2014-04-14 15:44:21
1481
原创 hdu 3311 Dig The Wells (SteinerTree斯坦纳树)
Problem DescriptionYou may all know the famousstory “Three monks”. Recently they find some places around their temples canbeen used to dig some wells. It will help them save a lot of time. But to di
2014-03-05 22:36:18
1563
原创 BNUT 1548 NEW YEARS 2014
Description In the New Year2014, Xiao Ming is thinking about the question: give two integers Nand K, Calculate thenumber of the numbers of satisfy the following conditions:1. It is a positiv
2014-02-18 17:27:03
803
原创 HDU 4411 Arrest
Problem DescriptionThere are (N+1) cities on TAT island. City 0 is where police headquarter located. The economy of other cities numbered from 1 to N ruined these years because they are all controll
2014-02-16 11:01:40
930
原创 HDU 4780 Candy Factory
ProblemDescription A newcandy factory opens in pku-town. The factory import M machines to produce highquality candies. These machines are numbered from 1 to M. There are N candies need to be pro
2014-02-16 11:00:38
861
原创 POJ 2135 Farm Tour
DescriptionWhen FJ's friendsvisit him on the farm, he likes to show them around. His farm comprises N (1<= N <= 1000) fields numbered 1..N, the first of which contains his houseand the Nth of which
2014-02-16 10:59:45
728
原创 POJ 1149 PIGS
DescriptionMirko works on apig farm that consists of M locked pig-houses and Mirko can't unlock anypighouse because he doesn't have the keys. Customers come to the farm one afteranother. Each of the
2014-02-16 10:58:46
752
原创 SGU 326 Perspective
Breaking news! A Russian billionaire has bought a yet undisclosed NBA team. He's planning to invest huge effort and money into making that team the best. And in fact he's been very specific about the
2014-02-16 10:57:46
709
原创 HDU 4322 Candy
ProblemDescriptionThere are Ncandies and M kids, the teacher will give this N candies to the M kids. Thei-th kids for the j-th candy has a preference for like[i][j], if he like thesugar, like[i][j]
2014-02-16 10:55:09
986
原创 POJ 2112 Optimal Milking
DescriptionFJ has moved his K(1 <= K <= 30) milking machines out into the cow pastures among the C (1<= C <= 200) cows. A set of paths of various lengths runs among the cowsand the milking machines.
2014-02-16 10:53:31
742
原创 POJ 1273 Drainage Ditches
DescriptionEvery time itrains on Farmer John's fields, a pond forms over Bessie's favorite cloverpatch. This means that the clover is covered by water for awhile and takesquite a long time to regrow
2014-02-16 10:42:19
752
原创 HDU 4436 str2int
ProblemDescriptionIn this problem,you are given several strings that contain only digits from '0' to '9',inclusive.An example is shown below.101123The set S of strings is consists of the N s
2014-02-16 10:36:17
737
原创 HDU 4622 Reincarnation
ProblemDescriptionNow you are back,andhave a task to do:Given you a string s consist of lower-case English letters only,denote f(s) asthe number of distinct sub-string of s.And you have some que
2014-02-16 10:16:27
780
原创 HDU 3518 Boring counting
ProblemDescription035 now faced atough problem,his english teacher gives him a string,which consists with nlower case letter,he must figure out how many substrings appear at leasttwice,moreover,such
2014-02-16 10:07:23
759
原创 POJ 3294 Life Forms
DescriptionYou may have wondered why most extraterrestrial life formsresemble humans, differing by superficial traits such as height, colour,wrinkles, ears, eyebrows and the like. A few bear no huma
2014-02-16 09:38:37
740
原创 POJ 1743 Musical Theme
DescriptionA musical melodyis represented as a sequence of N (1<=N<=20000)notes that are integers inthe range 1..88, each representing a key on the piano. It is unfortunate buttrue that this represe
2014-02-16 09:25:14
639
原创 HDU 1403 Longest Common Substring
ProblemDescriptionGiven two strings,you have to tell the length of the Longest Common Substring of them.For example:str1 = bananastr2 = cianaicSo the Longest Common Substring is "ana", a
2014-02-16 09:13:35
663
原创 POJ 3261 Milk Patterns
DescriptionFarmer John has noticed that the qualityof milk given by his cows varies from day to day. On further investigation, hediscovered that although he can't predict the quality of milk from on
2014-02-10 18:59:13
669
原创 HDU 2167 Pebbles
Problem DescriptionYou're given an unlimited number of pebbles to distributeacross an N x N game board (N drawn from [3, 15]), where each square on theboard contains some positive point value betwee
2014-02-09 19:48:56
859
原创 HDU 4778 Gems Fight!
Problem DescriptionAlice and Bob are playing "GemsFight!":There are Gems of G different colors , packedin B bags. Each bag has several Gems. G different colors are numbered fromcolor 1 to color G.
2014-02-09 17:24:45
1076
原创 HDU 4568 Hunter
Problem DescriptionOne day, a hunter named James went to amysterious area to find the treasures. James wanted to research the area andbrought all treasures that he could.The area can be represente
2014-02-09 14:45:16
1356
原创 HDU 2224 The shortest path
Problem DescriptionThere are n pointson the plane, Pi(xi, yi)(1 Before you reach the rightmost point Pn, you can only visit the points thosehave the bigger x-coordinate value. For example, you ar
2014-02-09 11:20:38
1430
原创 POJ 1947 Rebuilding Roads
DescriptionThe cows havereconstructed Farmer John's farm, with its N barns (1 <= N <= 150, number1..N) after the terrible earthquake last May. The cows didn't have time torebuild any extra roads, so
2014-02-09 10:45:22
631
原创 HDU 3593 The most powerful force
ProblemDescriptionThe leaders of ACcountry made a decision to regain the TW Island. But they have to face thepowerful force from USB. So the leaders have to hire some excellent soldiersfrom the trai
2014-02-09 10:28:29
1158
原创 ZOJ 3734 LIKE vs CANDLE
LIKE vs CANDLETime Limit: 2 Seconds Memory Limit: 65536 KBA microblog caused a war recently -There's the war between LIKE and CANDLE.As you see, there are N accounts are tryin
2014-02-09 09:46:29
995
原创 HDU 1054 Strategic Game
ProblemDescriptionBob enjoys playingcomputer games, especially strategic games, but sometimes he cannot find thesolution fast enough and then he is very sad. Now he has the following problem.He must
2014-02-09 09:19:49
639
原创 HDU 2412 Party at Hali-Bula
ProblemDescriptionDear Contestant,I'm going to have a party at my villa at Hali-Bula to celebrate my retirementfrom BCM. I wish I could invite all my co-workers, but imagine how an employeecan e
2014-02-09 08:59:49
739
原创 HDU 1158 Employment Planning
Problem DescriptionA project managerwants to determine the number of the workers needed in every month. He doesknow the minimal number of the workers needed in each month. When he hires orfires a wo
2014-01-31 20:42:15
781
原创 HDU 1081 To The Max
Problem DescriptionGiven atwo-dimensional array of positive and negative integers, a sub-rectangle is anycontiguous sub-array of size 1 x 1 or greater located within the whole array.The sum of a rec
2014-01-31 18:35:38
624
原创 hdu 1069 Monkey and Banana
Problem DescriptionA group of researchers aredesigning an experiment to test the IQ of a monkey. They will hang a banana atthe roof of a building, and at the mean time, provide the monkey with someb
2014-01-30 12:31:47
814
原创 hdu 1159 Common Subsequence
Problem DescriptionA subsequence of agiven sequence is the given sequence with some elements (possible none) leftout. Given a sequence X = another sequence Z = is a subsequence of X if there exi
2014-01-29 20:06:34
613
原创 hdu 1506 Largest Rectangle in a Histogram
Problem DescriptionA histogram is apolygon composed of a sequence of rectangles aligned at a common base line. Therectangles have equal widths but may have different heights. For example, thefigure
2014-01-29 19:44:19
642
原创 hdu 1864 最大报销额
Problem Description现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的最大报销额。 Input测试输入包含若干测试用例。每个测试用例的第1行包含两个正数 Q 和 N,
2014-01-29 18:33:54
876
原创 hdu 2955 Robberies
很久没写过题了。DP又是最拙计之处。只好从最简单的DP重新写一遍了 Problem DescriptionThe aspiring Roy the Robber has seen a lot of American movies, and knowsthat the bad guys usually gets caught in the end, often because they
2014-01-29 18:01:37
553
原创 求任意位数的水仙花数(阿姆斯特朗数)
首先,什么是水仙花数呢?水仙花数又叫阿姆斯特朗数。具体是什么,请看链接http://baike.baidu.com/link?url=EBzzLpQqAIeFTBaOCwciWJGB0wep4kFHuG8iPg8kQcPk6L7umAFTkp-mAsMHxPoE大概就是说,一个数有n位,这个数的每一位上的数的n次方之和等于这个数,这个数就是水仙花数。大一的时候做过这个题,给一个位数,让
2013-11-17 14:12:43
2183
原创 POJ 1182 食物链
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个动物,用
2013-08-31 14:10:52
656
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人