随笔分类 -  ACM-贪心

摘要:Alice and BobTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 559Accepted Submission(s): 224Problem DescriptionAlice and Bob's game never ends. Today, they introduce a new game. In this game, both of them have N different rectangular cards resp 阅读全文
posted @ 2012-09-10 15:41 mtry 阅读(1223) 评论(0) 推荐(0)
摘要:Color a TreeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 563Accepted Submission(s): 206Problem DescriptionBob is very interested in the data structure of a tree. A tree is a directed graph in which a special node is singled out, called the " 阅读全文
posted @ 2012-07-31 08:27 mtry 阅读(2276) 评论(1) 推荐(0)
摘要:Crixalis's EquipmentTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1379Accepted Submission(s): 559Problem DescriptionCrixalis - Sand King used to be a giant scorpion(蝎子) in the deserts of Kalimdor. Though he's a guardian of Lich King now, 阅读全文
posted @ 2012-07-30 11:26 mtry 阅读(1726) 评论(0) 推荐(1)
摘要:Data EncodingAccepted : 14Submit : 118Time Limit : 1000 MSMemory Limit : 1048576 KBData EncodingGiven a string S, your job is to encode it into a new string T using given charset C. To make the decoding easy, each original character X in S is encoded into a string Y made up of characters in C. What& 阅读全文
posted @ 2012-05-20 08:36 mtry 阅读(230) 评论(0) 推荐(0)
摘要:FatMouse' TradeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22453Accepted Submission(s): 6992Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBea 阅读全文
posted @ 2012-04-20 16:19 mtry 阅读(265) 评论(0) 推荐(0)
摘要:喷水装置(二)时间限制:3000 ms | 内存限制:65535 KB难度:4描述有一块草坪,横向长w,纵向长为h,在它的橫向中心线上不同位置处装有n(n<=10000)个点状的喷水装置,每个喷水装置i喷水的效果是让以它为中心半径为Ri的圆都被润湿。请在给出的喷水装置中选择尽量少的喷水装置,把整个草坪全部润湿。输入第一行输入一个正整数N表示共有n次测试数据。每一组测试数据的第一行有三个整数n,w,h,n表示共有n个喷水装置,w表示草坪的横向长度,h表示草坪的纵向长度。随后的n行,都有两个整数xi和ri,xi表示第i个喷水装置的的横坐标(最左边为0),ri表示该喷水装置能覆盖的圆的半径。输 阅读全文
posted @ 2012-04-19 01:09 mtry 阅读(1945) 评论(0) 推荐(0)
摘要:寻找最大数时间限制:1000 ms | 内存限制:65535 KB描述请在整数 n 中删除m个数字, 使得余下的数字按原次序组成的新数最大,比如当n=92081346718538,m=10时,则新的最大数是9888输入第一行输入一个正整数T,表示有T组测试数据每组测试数据占一行,每行有两个数n,m(n可能是一个很大的整数,但其位数不超过100位,并且保证数据首位非0,m小于整数n的位数)输出每组测试数据的输出占一行,输出剩余的数字按原次序组成的最大新数样例输入292081346718538 101008908 5样例输出988898算法分析:依次找出所有的值,len为数值的位数,n为要删掉的个 阅读全文
posted @ 2011-11-27 20:50 mtry 阅读(726) 评论(3) 推荐(0)
摘要:懒省事的小明时间限制:3000 ms | 内存限制:65535 KB难度:3描述 小明很想吃果子,正好果园果子熟了。在果园里,小明已经将所有的果子打了下来,而且按果子的不同种类分成了不同的堆。小明决定把所有的果子合成一堆。 因为小明比较懒,为了省力气,小明开始想点子了: 每一次合并,小明可以把两堆果子合并到一起,消耗的体力等于两堆果子的重量之和。可以看出,所有的果子经过n-1次合并之后,就只剩下一堆了。小明在合并果子时总共消耗的体力等于每次合并所耗体力之和。 因为还要花大力气把这些果子搬回家,所以小明在合并果子时要尽可能地节省体力。假定每个果子重量都为1,并且已知果子的种类数和每种果子的... 阅读全文
posted @ 2011-11-20 12:43 mtry 阅读(980) 评论(0) 推荐(0)
摘要:The TripA group of students are members of a club that travels annually to different locations. Their destinations in the past have included Indianapolis, Phoenix, Nashville, Philadelphia, San Jose, and Atlanta. This spring they are planning a trip to Eindhoven.The group agrees in advance to share e 阅读全文
posted @ 2011-09-29 15:08 mtry 阅读(281) 评论(0) 推荐(0)