2013年6月21日
摘要: DescriptionIn how many ways can you tile a 2xn rectangle by 2x1 or 2x2 tiles?Here is a sample tiling of a 2x17 rectangle.InputInput is a sequence of lines, each line containing an integer number 0 <= n <= 250.OutputFor each line of input, output one integer number in a separate line giving the 阅读全文
posted @ 2013-06-21 19:33 straw_berry 阅读(197) 评论(0) 推荐(0) 编辑
  2013年6月19日
摘要: 金牌、银牌、铜牌Time Limit: 1000MS Memory limit: 65536K题目描述Acm——大学中四大竞赛之首——是极具挑战性的大学生竞赛形式。在一场acm比赛中,一个参赛队伍由三人组合而成,在最短的时间内做出尽可能多的题目而且要尽量少提交错误代码,这样才能得到更高的排名。现在让我们模拟一次不正规的acm比赛,假设在比赛开始后30分钟(这时已经有不少同学提交了代码,在rating中已经出现),到比赛结束前,又有新的同学提交(在rating中出现),同时rating在不断变化着,还有一些同学因为一些原因中途退出比赛(这时rating中自动删除,当然在正式比赛中不会有这种情况) 阅读全文
posted @ 2013-06-19 02:03 straw_berry 阅读(563) 评论(0) 推荐(0) 编辑
  2013年6月18日
摘要: 双向链表Time Limit: 1000MS Memory limit: 65536K题目描述学会了单向链表,我们又多了一种解决问题的能力,单链表利用一个指针就能在内存中找到下一个位置,这是一个不会轻易断裂的链。但单链表有一个弱点——不能回指。比如在链表中有两个节点A,B,他们的关系是B是A的后继,A指向了B,便能轻易经A找到B,但从B却不能找到A。一个简单的想法便能轻易解决这个问题——建立双向链表。在双向链表中,A有一个指针指向了节点B,同时,B又有一个指向A的指针。这样不仅能从链表头节点的位置遍历整个链表所有节点,也能从链表尾节点开始遍历所有节点。对于给定的一列数据,按照给定的顺序建立双向 阅读全文
posted @ 2013-06-18 21:11 straw_berry 阅读(464) 评论(0) 推荐(0) 编辑
  2013年6月6日
摘要: Pixel densityTime Limit: 1000ms Memory limit: 65536K有疑问?点这里^_^题目描述Pixels per inch (PPI) or pixel density is a measurement of the resolution of devices in various contexts; typically computer displays, image scanners, and digital camera image sensors. Note, the unit is not square inches. Good quality 阅读全文
posted @ 2013-06-06 00:13 straw_berry 阅读(172) 评论(0) 推荐(0) 编辑
  2013年6月2日
摘要: Monkey and BananaTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5406Accepted Submission(s): 2769Problem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, an 阅读全文
posted @ 2013-06-02 00:54 straw_berry 阅读(234) 评论(0) 推荐(0) 编辑
  2013年5月31日
摘要: 上升子序列Time Limit: 1000ms Memory limit: 65536K有疑问?点这里^_^题目描述 一个只包含非负整数的序列bi,当b1 < b2 < ... < bS的时候,我们称这个序列是上升的。对于给定的一个序列{a1, a2, ...,aN},我们可以得到一些上升的子序列{ai1, ai2, ..., aiK},这里1 ≤ i1 < i2 <...< iK ≤ N。例如:对于序列{1, 7, 3, 5, 9, 4, 8},有它的一些上升子序列,如{1, 7}, {3, 4, 8}等等。这些子序列中序列和最大的是子序列{1, 3, 5 阅读全文
posted @ 2013-05-31 01:51 straw_berry 阅读(298) 评论(0) 推荐(0) 编辑
  2013年5月26日
摘要: Problem DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs some time, called setup time, for the machine to prepare processing a stick. The setup times are as 阅读全文
posted @ 2013-05-26 01:22 straw_berry 阅读(331) 评论(0) 推荐(0) 编辑
  2013年5月18日
摘要: Both Saya and Kudo like balloons. One day, they heard that in the central park, there will be thousands of people fly balloons to pattern a big image.They were very interested about this event, and also curious about the image.Since there are too many balloons, it is very hard for them to compute an 阅读全文
posted @ 2013-05-18 16:17 straw_berry 阅读(220) 评论(0) 推荐(0) 编辑
  2013年5月14日
摘要: JGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are located in two parallel lines.Half of these cities are rich in resource (we call them rich cities) while the others are short of resource (we call them poor cities). Each poor city is short of exactly one kind o 阅读全文
posted @ 2013-05-14 20:08 straw_berry 阅读(152) 评论(0) 推荐(0) 编辑
  2013年5月11日
摘要: 悼念512汶川大地震遇难同胞——来生一起走Time Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1839Accepted Submission(s): 925Problem Description妈妈你别哭泪光照亮不了我们的路让我们自己慢慢的走妈妈我会记住你和爸爸的模样记住我们的约定来生一起走上面这首诗节选自一位诗人纪念遇难同胞的作品,并没有华丽的语言,但是每位读者都应该能感受到作品传达的浓浓爱意,也许还有丝丝无奈。确实,太多的关于孩子不幸的报道冲击 阅读全文
posted @ 2013-05-11 21:56 straw_berry 阅读(201) 评论(0) 推荐(0) 编辑