杰拉斯的博客

归档:2012年4月月

[ACM_HDU_1050]Moving Tables

杰拉斯 杰拉斯 | 时间:2012-04-30, Mon | 24,079 views
编程算法 

Moving Tables

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 9950 Accepted Submission(s): 3389

Description

The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure.

[ACM_HDU_1050]Moving Tables

The floor has 200 rooms each on the north side and south side along the corridor. Recently the Company made a plan to reform its system. The reform includes moving a lot of tables between rooms. Because the corridor is narrow and all the tables are big, only one table can pass through the corridor. Some plan is needed to make the moving efficient. The manager figured out the following plan: Moving a table from a room to another room can be done within 10 minutes. When moving a table from room i to room j, the part of the corridor between the front of room i and the front of room j is used. So, during each 10 minutes, several moving between two rooms not sharing the same part of the corridor will be done simultaneously. To make it clear the manager illustrated the possible cases and impossible cases of simultaneous moving.

[ACM_HDU_1050]Moving Tables

For each room, at most one table will be either moved in or moved out. Now, the manager seeks out a method to minimize the time to move all the tables. Your job is to write a program to solve the manager’s problem.

(阅读全文…)

[ACM_ZJUT_1063]Lily's Puzzle

杰拉斯 杰拉斯 | 时间:2012-04-28, Sat | 8,671 views
编程算法 

Lily's puzzle

Time Limit:1000MS Memory Limit:32768K

Description

最近lily的好朋友Kingly在农场里干活,农场里种了很多树,Kingly的任务就是:给定树的位置,然后到农场里清点树的棵数,由于他比较死板,只会一棵棵去数,所以他的工资比别人少。而lily就提醒他用计算机,因为这是计算速度最快的东东!同时lily又想到了一个问题:如果给定一个区域的尺寸,怎么样才能数出这个范围内的树最多?
举个例子,在下图中,农场是一个宽为10长为8的矩形。

Lily's Puzzle

每个(*) 代表一棵树。 如果给定区域的一边为4另一边为3的,那么显然是左上方的小矩形区域中的树最多,是5棵。 你的任务就是解决上述的问题!

(阅读全文…)

[ACM_HDU_2037]今年暑假不AC

杰拉斯 杰拉斯 | 时间:2012-04-25, Wed | 51,705 views
编程算法 

今年暑假不AC

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 13173 Accepted Submission(s): 6807

Description

“今年暑假不AC?”

“是的。”

“那你干什么呢?”

“看世界杯呀,笨蛋!”

“@#$%^&*%...”

确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。
作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永远不要忘记关心国家大事)、非常6+7、超级女生,以及王小丫的《开心辞典》等等,假设你已经知道了所有你喜欢看的电视节目的转播时间表,你会合理安排吗?(目标是能看尽量多的完整节目)

(阅读全文…)

[ACM_HDU_1410]PK武林盟主

杰拉斯 杰拉斯 | 时间:2012-04-20, Fri | 21,656 views
编程算法 

PK武林盟主

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 621 Accepted Submission(s): 133

Description

枫之羽认为自己很强,想当武林盟主,于是找现任武林盟主氢氧化铜挑战。氢氧化铜欣然接受了挑战,两人约好于下个月的月圆之夜在HDU校园内的三根柱子上进行决战。这场PK赛肯定能吸引武林中所有人前来观战,所以他们找了有商业运作潜力的经济人你,让你来组织这场百年一见的世纪之战,假设两人都有一定的血HP1、HP2.HP1是枫之羽的,HP2是氢氧化铜的。他们也有一定攻击力AP1、AP2,AP1是枫之羽的,AP2是氢氧化铜的。当进行攻击时,对方的HP减少自己的攻击力,比如HP1=2 HP2=1 AP1=1 AP2=1,当氢氧化铜攻击枫之羽时,枫之羽的HP=2(原先的HP1)-1(氢氧化铜的AP2)=1。现在两个人对决很多回合,每回合不是枫之羽攻击氢氧化铜,就是氢氧化铜攻击枫之羽。求枫之羽能赢氢氧化铜成为下任武林盟主的的胜率。

(阅读全文…)

[ACM_NYOJ_270]Product of Digits

杰拉斯 杰拉斯 | 时间:2012-04-20, Fri | 18,309 views
编程算法 

Product of Digits

Time Limit: 1.0 second
Memory Limit: 16 MB

Description

Your task is to find the minimal positive integer number Q so that the product of digits of Q is exactly equal to N.

Input

The input contains the single integer number N (0 ≤ N ≤ 109).

Output

Your program should print to the output the only number Q. If such a number does not exist print −1.

(阅读全文…)