08 2012 档案
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1166Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。中央情报局要研究敌人究竟演习什么战术,所以Tidy要随时向Derek汇报某一段连续的工兵营地一共有多少人,例如De
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4158Problem DescriptionIn the game of Go, two players alternate placing black and white stones on lattice points of an n × n grid, each attempting to surround as much territory (i.e., regions of unfilled lattice points) as possible. At the end of the ga
阅读全文
摘要:Problem DescriptionWhen you go shopping, you can search in repository for avalible merchandises by the computers and internet. First you give the search system a name about something, then the system responds with the results. Now you are given a lot merchandise names in repository and some queries,
阅读全文
摘要:http://poj.org/problem?id=2001http://acm.hnu.cn/online/?action=problem&type=show&id=10338ShortestPrefixesTime Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KBTotal submit users: 50, Accepted users: 48Problem 10338 : No special judgementProblem descriptionA prefix of a string is
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1247Problem 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.InputStandard input consists of a number of lowercase words, one per li
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1671Problem 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 9112. Alice 97 625 9993. Bob 91 12 54 26In this case, it
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1251Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每个提问都是一个字符串.注意:本题只有一组测试数据,处理到文件结束.Output对于每个提问,给出以该字符串为
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1114Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is simple. Whenever some ACM member has any
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2191Problem Description急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴圆缺,人有旦夕祸福,未来对于我们而言是一个未知数。那么,我们要做的就应该是珍惜现在,感恩生活——感谢父母,他们给予我们生命,抚养我们成人;感
阅读全文
摘要:各个容器有很多的相似性。先学好一个,其它的就好办了。先从基础开始。先看看他们的分类吧标准STL序列容器:vector、string、deque和list。标准STL关联容器:set、multiset、map和multimap。非标准序列容器slist和rope。slist是一个单向链表,rope本质上是一个重型字符串。非标准关联容器hash_set、hash_multiset、hash_map和hash_multimap。(各容器成员对比见:【STL】各容器成员对比表)先看看list。listSTL中的list就是一双向链表,可高效地进行插入删除元素。list不支持随机访问。所以没有 at(p
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2540Problem Description在一个广场上有一排沿着东西方向排列的石柱子,阳光从东边以一定的倾角射来(平行光)。有的柱子可能被在他东边的高大的柱子的影子给完全遮挡住了。现在你要解决的问题是求出有多少柱子是没有被完全遮挡住的。假设每个石柱子是一根细棒,而且都垂直于地面摆放。Input输入包含多组数据。每组数据第一行是一个整数N(0<N<=100000),表示柱子的个数。N=0代表输入结束。接下来有N行,每行是两个整数,分别给出每根柱子的水平位置X和高度H(X越大,表示越在西边,0<
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2545Problem Description给一棵树,如果树上的某个节点被某个人占据,则它的所有儿子都被占据,lxh和pfz初始时分别站在两个节点上,谁当前所在的点被另一个人占据,他就输了比赛,问谁能获胜Input输入包含多组数据每组第一行包含两个数N,M(N,M<=100000),N表示树的节点数,M表示询问数,N=M=0表示输入结束。节点的编号为1到N。接下来N-1行,每行2个整数A,B(1<=A,B<=N),表示编号为A的节点是编号为B的节点的父亲接下来M行,每行有2个数,表示lxh和
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1598Problem DescriptionXX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度的差越小乘坐越舒服 ,(理解为SARS的限速要求,flycar必须瞬间提速/降速,痛苦呀 ),但XX星人对时间却没那么多要求。要你找出一条城市间的最舒适的路径。(SARS是双向的)。I
阅读全文
摘要:转自:http://www.cnblogs.com/Mu-Tou/archive/2011/08/11/2135405.html要学习匈牙利算法先要懂得二部图的各种概念。。下面给出由o(∩_∩)o MiYu 总结的一般性概念,这些概念很重要,一定要懂。。二分图的基本概念: ( 意思就是所有的点分成了2个集合 x, y. 每个集合中的顶点相互间没有边 )一个无向图 G = < V, E >, 如果存在两个集合X, Y, 使得X∪Y=V, X∩Y=Φ, 并且每一条边e={x, y}有x∈X,y∈Y, 则称G为一个二分图(bipartite graph). 常用来表示一个二分图. 若对X
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1597Problem Description假设:S1 = 1S2 = 12S3 = 123S4 = 1234.........S9 = 123456789S10 = 1234567891S11 = 12345678912............S18 = 123456789123456789..................现在我们把所有的串连接起来S = 1121231234.......123456789123456789112345678912.........那么你能告诉我在S串中的第N个数字是多
阅读全文
摘要:Problem DescriptionXX星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,1),一条从u 到 v 的通道P 的安全度为Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边 ,现在8600 想出去旅游,面对这这么多的路,他想找一条最安全的路。但是8600 的数学不好,想请你帮忙 ^_^Input输入包括多个测试实例,每个实例包括:第一行:n。n表示城市的个数n<=1000;接着是一个n*n的矩阵表示两个城市之间的安全系数,(0可以理解为那两个城
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1281Problem Description小希和Gardon在玩一个游戏:对一个N*M的棋盘,在格子里放尽量多的一些国际象棋里面的“车”,并且使得他们不能互相攻击,这当然很简单,但是Gardon限制了只有某些格子才可以放,小希还是很轻松的解决了这个问题(见下图)注意不能放车的地方不影响车的互相攻击。 所以现在Gardon想让小希来解决一个更难的问题,在保证尽量多的“车”的前提下,棋盘里有些格子是可以避开的,也就是说,不在这些格子上放车,也可以保证尽量多的“车”被放下。但是某些格子若不放子,就无法保证放尽量多
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1258Problem DescriptionGiven a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For example, if t=4, n=6, and the list is [4,3,2,2,1,1], then there are four different sums that equal 4: 4,3+1,2+
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1301Problem DescriptionThe Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so the large road network is too expe
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1217Problem 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 Dollar buys 0.5 British pound, 1 British pound buys 10.0
阅读全文
摘要:Problem DescriptionEddy begins to like painting pictures recently ,he is sure of himself to become a painter.Every day Eddy draws pictures in his small room, and he usually puts out his newest pictures to let his friends appreciate. but the result it can be imagined, the friends are not interested i
阅读全文

浙公网安备 33010602011771号