随笔分类 -  ACM-类型

1 2 下一页
把一个完全图分成两部分
摘要:A university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the ne... 阅读全文
posted @ 2014-05-22 16:48 903SW-BAO 阅读(262) 评论(0) 推荐(0)
拓扑排序
摘要:这道题有隐含这一信息,每输入一对关系,如果判定有结果,则可以忽略后面输入数据,即使后面输入数据能改变结果,也不用管。所以应该每输入一个关系就去更新当前的图,然后进行一趟拓扑排序。一旦产生结果,再对后面的数据处理下,就可以输出结果。所有可能的情况罗列:(独家经验原创,重中之重!可以说没有这些,这题就无... 阅读全文
posted @ 2014-05-22 15:25 903SW-BAO 阅读(199) 评论(0) 推荐(0)
prim+BFS
摘要:大致题意:在一个y行 x列的迷宫中,有可行走的通路空格’ ‘,不可行走的墙’#’,还有两种英文字母A和S,现在从S出发,要求用最短的路径L连接所有字母,输出这条路径L的总长度。一格的长度为1,而且移动的方法只有上、下、左、右,所以在无任何墙的情况下(但“墙#”是必须考虑的,这里只是为了说明)任意两个... 阅读全文
posted @ 2014-05-22 15:20 903SW-BAO 阅读(206) 评论(0) 推荐(0)
最小生成树
摘要:Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs you... 阅读全文
posted @ 2014-05-22 15:10 903SW-BAO 阅读(156) 评论(0) 推荐(0)
最小生成树(修路)
摘要:/*题意:Flatopia岛要修路,这个岛上有n个城市,要求修完路后,各城市之间可以相互到达,且修的总路程最短.求所修路中的最长的路段*/Sample Input130 990 692990 0 179692 179 0Sample Output692#include #define MAX 502... 阅读全文
posted @ 2014-05-22 15:08 903SW-BAO 阅读(277) 评论(0) 推荐(0)
字母最小生成树
摘要:题意大概是这样的:用一个7位的string代表一个编号,两个编号之间的distance代表这两个编号之间不同字母的个数。一个编号只能由另一个编号“衍生”出来,代价是这两个编号之间相应的distance,现在要找出一个“衍生”方案,使得总代价最小,也就是distance之和最小。例如有如下4个编号:a... 阅读全文
posted @ 2014-05-22 15:06 903SW-BAO 阅读(243) 评论(0) 推荐(0)
floyd算法汇率
摘要:Arbitrage 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... 阅读全文
posted @ 2014-05-22 14:53 903SW-BAO 阅读(197) 评论(0) 推荐(0)
floyd算法
摘要:问题重述描述众所周知,证券经纪业依靠的就是过度的传言。您需要想出股票经纪人中传播假情报的方法,让您的雇主在股票市场的占据优势。为了获得最大的效果,你必须蔓延最快的方式谣言。不幸的是你,股票经纪人信息只信任他们的“可靠来源”,这意味着你在你传播谣言之前必须考虑到他们的接触结构。它需要特定股票经纪人和一... 阅读全文
posted @ 2014-05-22 14:17 903SW-BAO 阅读(185) 评论(0) 推荐(0)
floyd算法 青蛙
摘要:题目大意:给出两只青蛙的坐标A、B,和其他的n-2个坐标,任一两个坐标点间都是双向连通的。显然从A到B存在至少一条的通路,每一条通路的元素都是这条通路中前后两个点的距离,这些距离中又有一个最大距离。现在要求求出所有通路的最大距离,并把这些最大距离作比较,把最小的一个最大距离作为青蛙的最小跳远距离。F... 阅读全文
posted @ 2014-05-22 14:16 903SW-BAO 阅读(252) 评论(0) 推荐(0)
昂贵的聘礼
摘要:年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就... 阅读全文
posted @ 2014-05-22 14:13 903SW-BAO 阅读(210) 评论(0) 推荐(0)
货币兑换
摘要:题意:有若干种货币,某些币种之间可兑换,给出各种兑换时的汇率和手续费,任何兑换都是双向的,但是两个方向的汇率和手续费可能不同,并告知你现在拥有的货币种类(只拥有一种)及数量,问是否可以通过货币建兑换最后回到本币种后钱数有所增加。分析:普通的货币兑换一般都是用floyd。但是本题除了汇率还多出一个条件... 阅读全文
posted @ 2014-05-22 14:11 903SW-BAO 阅读(170) 评论(0) 推荐(0)
简单模拟与2993相反
摘要:Your task is to read a picture of a chessboard position and print it in the chess notation.InputThe input consists of an ASCII-art picture of a chessb... 阅读全文
posted @ 2014-05-22 13:55 903SW-BAO 阅读(186) 评论(0) 推荐(0)
字符串处理和显示
摘要:DescriptionThis problem is a reverse case of theproblem 2996. You are given the output of the problem H and your task is to find the corresponding inp... 阅读全文
posted @ 2014-05-22 13:52 903SW-BAO 阅读(160) 评论(0) 推荐(0)
几步能走出矩阵或者走入循环
摘要:DescriptionA robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down ... 阅读全文
posted @ 2014-05-22 13:49 903SW-BAO 阅读(372) 评论(0) 推荐(0)
机器人在盘内是否会相撞
摘要:The first line of input is K, the number of test cases. Each test case starts with one line consisting of two integers, 1 Whereis one ofL: turn lef... 阅读全文
posted @ 2014-05-22 13:47 903SW-BAO 阅读(235) 评论(0) 推荐(0)
模拟括号
摘要:Let S = s1 s2...s2n be a well-formed string of parentheses. S can be encoded in two different ways:q By an integer sequence P = p1 p2...pn where pi is... 阅读全文
posted @ 2014-05-22 12:29 903SW-BAO 阅读(157) 评论(0) 推荐(0)
构造发
摘要:本题中最多5个命题变项:p,q,r,s,t每个有0,1两种取值,所以总共32种情况,分别枚举即可。对于每种情况,计算表达式的值,如果有结果为0的则输出not难点在于如何计算表达式的值,我们采用递归的方法,把表达式分为一或两个子表达式,并把参数end(本表达式的结束位置)传给上一层,一遍上一层获取第二... 阅读全文
posted @ 2014-05-22 12:27 903SW-BAO 阅读(170) 评论(0) 推荐(0)
贪心(盈利问题)
摘要:DescriptionAccounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data for preparing annual report for MS Inc.All... 阅读全文
posted @ 2014-05-22 12:23 903SW-BAO 阅读(180) 评论(0) 推荐(0)
贪心
摘要:#include #include using namespace std;int main(){ double n,p; while (cin>>n>>p) cout=1 and an integer p>= 1 you have to write a program t... 阅读全文
posted @ 2014-05-22 12:21 903SW-BAO 阅读(124) 评论(0) 推荐(0)
枚举(+-)
摘要:The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator.There are 16 handles on the refr... 阅读全文
posted @ 2014-05-22 12:10 903SW-BAO 阅读(159) 评论(0) 推荐(0)

1 2 下一页