01 2014 档案

摘要:Problem DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,000) on the same number line. Farmer John has two modes of transportation: walking 阅读全文
posted @ 2014-01-15 21:12 AHU_树 阅读(175) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 2 #include 3 int map[210]; 4 int bfs(int a,int b); 5 int queue[10000]; 6 int mark[10000]; 7 int step[10000]; 8 int n; 9 int main()10 {11 int a,b;12 while(scanf("%d",& 阅读全文
posted @ 2014-01-15 21:10 AHU_树 阅读(227) 评论(0) 推荐(0) 编辑
摘要:Problem 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 squares on a chessboard exactly once. He thinks that the most difficult part of the problem is determi 阅读全文
posted @ 2014-01-15 21:09 AHU_树 阅读(282) 评论(0) 推荐(0) 编辑
摘要:Problem DescriptionNow an emergent task for you is to open a password lock. The password is consisted of four digits. Each digit is numbered from 1 to 9. Each time, you can add or minus 1 to any digit. When add 1 to '9', the digit will change to be '1' and when minus 1 to '1' 阅读全文
posted @ 2014-01-15 21:03 AHU_树 阅读(298) 评论(0) 推荐(0) 编辑
摘要:Description平时不努力,考试得着急呐。传说中的BT监考老师竟然搬来了信号屏蔽工具,手机不管用啦有木有。不过这难不到大家,cxlove见证了同学们使用传统的作弊方式----传纸条,纸条得从A同学传到B同学处,在一个N*M的教室里,零散着坐着一些同学,监考老师游荡在教室某些位置,能否成功将纸条传到B同学处,且不被老师发现。每一次传纸条不能斜传,只能传给前后左右四个同学,监考老师的监视范围为相邻的八个位置,当纸条传到老师监视范围内就会被逮住了,纸条传到空位置处时传送失败。 帮cxlove计算下最少需要多少时间才能完成传纸条。Input多组测试数据第一行两个整数,N,M(1 #include 阅读全文
posted @ 2014-01-15 20:59 AHU_树 阅读(306) 评论(0) 推荐(0) 编辑
摘要:DescriptionDue to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 #include int visited[111][111],movex[8]={-1,-1,0,1,1,1,0,-1},movey[8]={0,-1,-1,-1,0,1,1,1},nx[100000],ny[100000]; char map[111][111]; void dfs(int i,int j);. 阅读全文
posted @ 2014-01-15 20:56 AHU_树 阅读(157) 评论(0) 推荐(0) 编辑
摘要:Description500年前,Jesse是我国最卓越的剑客。他英俊潇洒,而且机智过人^_^。突然有一天,Jesse心爱的公主被魔王困在了一个巨大的迷宫中。Jesse听说这个消息已经是两天以后了,他知道公主在迷宫中还能坚持T天,他急忙赶到迷宫,开始到处寻找公主的下落。 时间一点一点的过去,Jesse还是无法找到公主。最后当他找到公主的时候,美丽的公主已经死了。从此Jesse郁郁寡欢,茶饭不思,一年后追随公主而去了。T_T 500年后的今天,Jesse托梦给你,希望你帮他判断一下当年他是否有机会在给定的时间内找到公主。他会为你提供迷宫的地图以及所剩的时间T。请你判断他是否能救出心爱的公主。In 阅读全文
posted @ 2014-01-15 20:55 AHU_树 阅读(308) 评论(0) 推荐(0) 编辑
摘要:高数70你敢信???临考前各种复习做卷子 各种认真 考试的时候感觉题目也都能做 尼玛连上平时分才给我70? 特么我是不信 打电话问问老师 如果没录错果断重修 郁闷 阅读全文
posted @ 2014-01-15 10:10 AHU_树 阅读(98) 评论(0) 推荐(0) 编辑
摘要:Description战争期间,双方互打信息战,我军准备去敌方一条战斗主线上的信息塔窃取他们的信息。敌方的信息塔排成了一条线,每个信息塔都会同时向两侧(两端的塔只向一侧)严格比自己高的最近的信息塔传送信息。现在时间紧迫,我们只能去其中一个信息塔,为了最高效的窃取敌人的信息,我们必须选择其中信息接收量最大的塔。现在请你去执行这个窃取任务。Input第1行,一个整数N(1#include using namespace std;typedef struct{ int data; int num; int index;}node;node tower[2000001];int main(){ int 阅读全文
posted @ 2014-01-14 20:17 AHU_树 阅读(220) 评论(0) 推荐(0) 编辑
摘要:DescriptionA color reduction is a mapping from a set of discrete colors to a smaller one. The solution to this problem requires that you perform just such a mapping in a standard twenty-four bit RGB color space. The input consists of a target set of sixteen RGB color values, and a collection of arbi 阅读全文
posted @ 2014-01-14 19:21 AHU_树 阅读(354) 评论(0) 推荐(0) 编辑
摘要:\后加上三个数字 这三个数字以八进制表示 但是这三个数字必须小于128 因为char表示2^7-1\加上1、2个数字 也是八进制\加上4个数字看情况 如\2444 244>127所以拆成'\24''4''4'三个字符如果是\1222 则拆成'\122' '2'两个字符 阅读全文
posted @ 2014-01-10 11:08 AHU_树 阅读(117) 评论(0) 推荐(0) 编辑
摘要:DescriptionThe least common multiple (LCM) of a set of positive integers is the smallest positive integer which isdivisible by all the numbers in the set. For example, the LCM of 5, 7 and 15 is 105.InputInput will consist of multiple problem instances. The first line of the input file will contain a 阅读全文
posted @ 2014-01-09 20:02 AHU_树 阅读(205) 评论(1) 推荐(1) 编辑
摘要:Description宣讲会上有连续编号为1...N的N个座位,每个座位只能坐一个人,有N个人,学校有M个不同专业,如果相邻座位的同学的专业相同,就会发生悄悄话现象,求有多少种情况可能发生悄悄话现象。(不一定每个专业都有人来)Input输入包括多组数据,以文件(EOF)结束。每组测试数据两个整数N(1int pow(int n,int m)//求m^n{ int sum=1; int i; for(i=0;i<n;i++) sum*=m; return sum;}int main(){ int n,m; while(scanf("%d%d",&n,&m 阅读全文
posted @ 2014-01-09 16:57 AHU_树 阅读(255) 评论(2) 推荐(1) 编辑
摘要:Description期末成绩出来了,又是58,59,无奈啊,yobobobo无法接受这个现实,于是暗下决定:从此之后,5,8,9这些数字将在我的字典里消失!现在yobobobo的世界里没有5,8,9,所以他世界里的数值和我们不一样,在他的世界里,4之后就到了6(我们当然是5),所以yobobobo的世界是这样的:1,2,3,4,6,7,10,11,12,13,14,16,,17……..47,60……,现在给你一个yobobobo世界里的数值N,请输出他原来的数值(比如6,其实它本来是5)。Input输入包括多组数据,以文件(EOF)结束。每组测试数据一个整数N(0int pow(int n) 阅读全文
posted @ 2014-01-09 15:18 AHU_树 阅读(185) 评论(0) 推荐(0) 编辑
摘要:Description德玛的经典台词:人在塔在。由于最近LOL增加了草丛数量(草丛伦怎能不开心?!)由于太过于兴奋,盖伦突然变成白痴了- -,连最经典的台词都变为:人在塔亡(变身剑圣?),德玛现在的症状是:如果该单词在句子中的序号为素数的话,他就会把这个单词反过来说(abcd -> dcba),为了治疗盖伦,你得和盖伦交流,寻求找到治疗他的方法。德玛说话完全变反了,现在你的任务是将盖伦的话翻译回他本来的意思,比如德玛说:i evil dna tower tsixe其实他的本意是i live and tower exist(因为2,3,5是素数,所以这些位置上的单词反过来了)注意:1不是素 阅读全文
posted @ 2014-01-09 10:16 AHU_树 阅读(136) 评论(0) 推荐(0) 编辑
摘要:DescriptionRoy has just moved into a new apartment. Well, actually the apartment itself is not very new, even dating back to the days before people had electricity in their houses. Because of this, Roy's apartment has only one single wall outlet, so Roy can only power one of his electrical appli 阅读全文
posted @ 2014-01-09 10:13 AHU_树 阅读(147) 评论(0) 推荐(0) 编辑
摘要:Description相传有一天,诸葛亮把将士们召集在一起,说:“你们中间不论谁,从1~1024中任意挑选一个整数,记在心里,我提十个问题,只要求回答'是'或'大于','小于'.十个问题全答完以后,我 就会‘算’出你心里记的那个数。”诸葛亮刚说完,一个谋士站起来说,他已经选好了一个数。诸葛亮问道:“你选的数大于512?”谋士答:“不是。”诸葛亮又接连向这,谋士提了九个问题,谋士一一作了回答。诸葛亮最后说:“你记的那个数是1。”谋士听了极为惊奇,因为这个数字真是他选的数。你知道诸葛亮是怎么妙算的吗?现在给你一个整数N,表示你要猜一个范围为【1,N】 阅读全文
posted @ 2014-01-09 10:06 AHU_树 阅读(295) 评论(0) 推荐(0) 编辑
摘要:DescriptionAnna, Betty, Cindy and Zelda like playing the card game Euchre. Euchre is a game for two teams of two, and each time they meet the girls split off into different teams. They also keep overall records of the number of games each player has won and lost. Anna has misplaced her won-loss resu 阅读全文
posted @ 2014-01-09 10:04 AHU_树 阅读(126) 评论(0) 推荐(0) 编辑
摘要:初期:一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996)二.图算法: (1)图的深度优先遍历和广度优先遍历. (2)最短路径算法(dijkstra,bellman-ford,floyd,heap+dijkstra) (poj1860,poj3259,poj1062,poj2253,poj1125,poj2240) (3)最小生成树算法(prim,krus 阅读全文
posted @ 2014-01-05 20:55 AHU_树 阅读(120) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示