摘要: Count ColorTime Limit:1000MSMemory Limit:65536KTotal Submissions:29895Accepted:8919DescriptionChosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem.There is a very long board with length L centimeter, L is a posit 阅读全文
posted @ 2013-04-25 10:01 Jack Ge 阅读(2892) 评论(4) 推荐(0) 编辑
摘要: 离散化是程序设计中一个非常常用的技巧,它可以有效的降低时间复杂度。其基本思想就是在众多可能的情况中“只考虑我需要用的值”。下面我将用三个例子说明,如何运用离散化改进一个低效的,甚至根本不可能实现的算法。《算法艺术与信息学竞赛》中的计算几何部分,黄亮举了一个经典的例子,我认为很适合用来介绍离散化思想。这个问题是UVA10173(http://acm.uva.es/p/v101/10173.html),题目意思很简单,给定平面上n个点的坐标,求能够覆盖所有这些点的最小矩形面积。这个问题难就难在,这个矩形可以倾斜放置(边不必平行于坐标轴)。这里的倾斜放置很不好处理,因为我们不知道这个矩形最终会倾斜多 阅读全文
posted @ 2013-04-25 09:32 Jack Ge 阅读(362) 评论(0) 推荐(0) 编辑
摘要: Frequent valuesTime Limit:2000MSMemory Limit:65536KTotal Submissions:11083Accepted:4063DescriptionYou are given a sequence ofnintegersa1, a2, ... , anin non-decreasing order. In addition to that, you are given several queries consisting of indicesiandj(1 ≤ i ≤ j ≤ n). For each query, determine the m 阅读全文
posted @ 2013-04-25 09:29 Jack Ge 阅读(262) 评论(0) 推荐(0) 编辑
摘要: Mayor's postersTime Limit:1000MSMemory Limit:65536KTotal Submissions:32200Accepted:9347DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally 阅读全文
posted @ 2013-04-25 09:02 Jack Ge 阅读(2281) 评论(0) 推荐(0) 编辑
摘要: HotelTime Limit:5000MSMemory Limit:30000KTotal Submissions:1584Accepted:645DescriptionThe "Informatics" hotel is one of the most luxurious hotels from Galaciuc. A lot of tourists arrive or leave this hotel in one year. So it is pretty difficult to keep the evidence of the occupied rooms. B 阅读全文
posted @ 2013-04-25 08:46 Jack Ge 阅读(560) 评论(0) 推荐(0) 编辑
摘要: Just a HookTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11425Accepted Submission(s): 5650Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecu 阅读全文
posted @ 2013-04-25 08:21 Jack Ge 阅读(264) 评论(0) 推荐(0) 编辑
摘要: HotelTime Limit:3000MSMemory Limit:65536KTotal Submissions:8736Accepted:3701DescriptionThe cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake Superior. Bessie, ever the competent travel agent, has named the Bullmoose Hotel 阅读全文
posted @ 2013-04-25 08:08 Jack Ge 阅读(246) 评论(0) 推荐(0) 编辑
摘要: Tunnel WarfareTime Limit:1000MSMemory Limit:131072KTotal Submissions:5985Accepted:2440DescriptionDuring the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected by tunnels lay in a line. Except the 阅读全文
posted @ 2013-04-25 07:28 Jack Ge 阅读(290) 评论(0) 推荐(0) 编辑