08 2015 档案
摘要:DescriptionFat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this b...
阅读全文
摘要:DescriptionGerald got a very curious hexagon for his birthday. The boy found out that all the angles of the hexagon are equal to. Then he measured the...
阅读全文
摘要:DescriptionDuring the early stages of the Manhattan Project, the dangers of the new radioctive materials were not widely known. Vast new factory citie...
阅读全文
摘要:DescriptionIn the Fibonacci integer sequence,F0= 0,F1= 1, andFn=Fn− 1+Fn− 2forn≥ 2. For example, the first ten terms of the Fibonacci sequence are:0, ...
阅读全文
摘要:Description大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了!做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的道理一样。话虽这样说,我还是要告诉大家,要想失败到一定程度也是不容易的。比如,我高中的时候,就有一个神奇的女生,在英语...
阅读全文
摘要:DescriptionTomorrow is contest day, Are you all ready?We have been training for 45 days, and all guys must be tired.But , you are so lucky comparing w...
阅读全文
摘要:DescriptionThe Sky is Sprite.The Birds is Fly in the Sky.The Wind is Wonderful.Blew Throw the TreesTrees are Shaking, Leaves are Falling.Lovers Walk p...
阅读全文
摘要:N -概率Time Limit:4000MSMemory Limit:32768KB64bit IO Format:%lld & %lluSubmitStatusDescriptionAs Harry Potter series is over, Harry has no job. Since he...
阅读全文
摘要:DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范...
阅读全文
摘要:Description 小明对数的研究比较热爱,一谈到数,脑子里就涌现出好多数的问题,今天,小明想考考你对素数的认识。 问题是这样的:一个十进制数,如果是素数,而且它的各位数字和也是素数,则称之为“美素数”,如29,本身是素数,而且2+9 = 11也是素数,所以它是美素数。 给定一个区间,你能...
阅读全文
摘要:DescriptionThere is a hill with n holes around. The holes are signed from 0 to n-1.A rabbit must hide in one of the holes. A wolf searches the rabbit ...
阅读全文
摘要:SubmitStatusDescriptionSometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in...
阅读全文
摘要:E -期望(经典问题)Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%lld & %lluSubmitStatusDescriptionGiven a dice withnsides, you have to find the expect...
阅读全文
摘要:DescriptionYou are in a cave, a long cave! The cave can be represented by a1 x Ngrid. Each cell of the cave can contain any amount of gold.Initially y...
阅读全文
摘要:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=30728一个立体方块,每个单位方块都是关闭状态,每次任两个点,以这两点为对角线的一个立方体状态都会进行一次转变,(开变成关,关变成开)如此进行k次后,问开着的灯的期望值思路:枚举...
阅读全文
摘要:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18546题意:有n个人会去超市,其中只有r个人会买东西,每个人独自买东西的概率会给出,问这一群人去买东西,第i个人属于r之中的概率是多少思路:首先得了解什么是条件概率.条件概率:...
阅读全文
摘要:---恢复内容开始---http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=31471题意,两辆火车,分别会在[t1,t2],[s1,s2]的时间段停留在同一个站点w分钟,问两辆火车能够在这个站点相遇的概率。思路,枚举每一种情况,把...
阅读全文
摘要:推荐在线例题:http://acm.nyist.net/JudgeOnline/problem.php?pid=16题摘:矩形嵌套时间限制:3000ms | 内存限制:65535KB难度:4描述有n个矩形,每个矩形可以用a,b来描述,表示长和宽。矩形X(a,b)可以嵌套在矩形Y(c,d)中当且仅当a...
阅读全文
摘要:K -背包Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionNow you are asked to measure a dose of medicine with a b...
阅读全文
摘要:DescriptionWe give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence,ifsis a regul...
阅读全文
摘要:DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 ...
阅读全文
摘要:Hrdv is interested in a string,especially the palindrome string.So he wants some palindrome string.A sequence of characters is a palindrome if it is t...
阅读全文
摘要:DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write...
阅读全文
摘要:Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the...
阅读全文
摘要:Description The world financial crisis is quite a subject. Some people are more relaxed while others are quite anxious. John is one of them. He is ver
阅读全文
摘要:DescriptionIn a few months the European Currency Union will become a reality. However, to join the club, the Maastricht criteria must be fulfilled, an...
阅读全文
摘要:DescriptionLetxandybe two strings over some finite alphabetA. We would like to transformxintoyallowing only operations given below:Deletion:a letter i...
阅读全文
摘要:Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusDescription一组研究人员正在设计一项实验,以测试猴子的智商。他们将挂香蕉在建筑物的屋顶,同时,提供一些砖块给这些猴子。如果猴子足够聪明...
阅读全文
摘要:A - 最大子段和 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status A - 最大子段和 Submit Status Description Given a sequence a[1]
阅读全文
摘要:UVA1471Defense LinesTime Limit:3000MSMemory Limit:Unknown64bit IO Format:%lld & %lluSubmitStatusDescriptionAfter the last war devastated your country,...
阅读全文
摘要:Advertisement:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=21426经典的区间选点问题,要求每个区间内的点数满足条件k个,具体做法是把右端点从小到大排序,然后每次都检查区间内的点数,如果少了,就尽量从右边开始加...
阅读全文
摘要:1.会场安排问题:会场安排问题时间限制:3000ms | 内存限制:65535KB难度:4描述学校的小礼堂每天都会有许多活动,有时间这些活动的计划时间会发生冲突,需要选择出一些活动进行举办。小刘的工作就是安排学校小礼堂的活动,每个时间最多安排一个活动。现在小刘有一些活动计划的时间表,他想尽可能的安排...
阅读全文
摘要:DescriptionThere areNmarbles, which are labeled1, 2,...,N. TheNmarbles are put in a circular track in an arbitrary order. In the top part of the track...
阅读全文
摘要:A permutation on the integers from 1 to n is, simply put, a particular rearrangement of these integers. Your task is to generate a given permutation f...
阅读全文
摘要:原题:poj3061 题意:给你一个数s,再给出一个数组,要求你从中选出m个连续的数,m越小越好,且这m个数之和不小于s 这是一个二分查找优化题,那么区间是什么呢?当然是从1到数组长度了。比如数组长度为10,你先找5,去枚举每一个区间为5的连续的数,发现存在这样的数,那么就可以继续往左找,反之则往右
阅读全文
摘要:原题:UVA11078 题意:给你一个数组,设a[],求一个m=a[i]-a[j],m越大越好,而且i必须小于j 怎么求?排序?要求i小于j呢。枚举?只能说超时无上限。所以遍历一遍数组,设第一个被减数为a【0】,之后遇到比a【0】大的数就更新它,再拿这个被减数去减数组中的每一个元素,同时也要不断地更
阅读全文
摘要:Description John Doe is a famous DJ and, therefore, has the problem of optimizing the placement of songs on his tapes. For a given tape and for each s
阅读全文
摘要:UVA 11572 唯一的雪花 题意:给你从1到n的数组,要求求得其中的最长连续不重复子序列,经典的滑窗问题,方法是维护一个窗口,设置左框和右框,然后不断的进行维护和更新 方法一: #include"iostream" #include"set" #include"cstring" #include
阅读全文
摘要:Description The SUM problem can be formulated as follows: given four lists A, B, C, D<tex2html_verbatim_mark> of integer values, compute how many quad
阅读全文
摘要:Description Shaass has n books. He wants to make a bookshelf for all his books. He wants the bookshelf's dimensions to be as small as possible. The th
阅读全文
摘要:Description Most financial institutions had become insolvent during financial crisis and went bankrupt or were bought by larger institutions, usually
阅读全文
摘要:G - 贪心 Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status G - 贪心 Submit Status Description Simon and Garfunkel Corporation (
阅读全文
摘要:Description A set of n<tex2html_verbatim_mark> 1-dimensional items have to be packed in identical bins. All bins have exactly the same length l<tex2ht
阅读全文
摘要:UVA10382 :http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=21419 只能说这道题和D题是一模一样的,不过要进行转化,这道题有一道坑,方法一需要使用scanf()输入,还需判断输入的正确性,即scanf()==3。。。
阅读全文
摘要:原题 UVA10020 :http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=19688 经典的贪心问题,区间上贪心当然是右区间越右越好了,当然做区间要小于等于当前待覆盖的位置,我们可以用一个变量begin代表当前待覆盖的区间的左值
阅读全文
摘要:Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6639 Accepted Submission(s): 2514 Problem Descrip
阅读全文
摘要:恢复内容开始 Description Before the invention of book-printing, it was very hard to make a copy of a book. All the contents had to be re-written by hand by
阅读全文
摘要:原题poj 2299:http://poj.org/problem?id=2299 题意,给你一个数组,去统计它们的逆序数,由于题目中说道数组最长可达五十万,那么O(n^2)的排序算法就不要再想了,归并排序~~~ 这里列出归并的解法: #include <iostream> #include <cs
阅读全文
摘要:题意 给出如图案例,要你从某一点开始走,一直走到极限(即无法再进行扩展),这时你走过的点会连成一个数,不同的走法当然会有不同的数,要求是输出最大的数(注意每个方块走过一次就不能再走) 思路 •1.枚举所有的点作为起点,然后求从这个点所能得到的最大数 •2.然后是使用DFS求从某一点可以到达的最大数
阅读全文