- 5
- 0
- 约6.27千字
- 约 5页
- 2016-12-25 发布于重庆
- 举报
/showproblem.php?pid=3698
Let the light guide us
Time Limit: 5000/2000 MS (Java/Others)????Memory Limit: 62768/32768 K (Java/Others)Total Submission(s): 759????Accepted Submission(s): 253
Problem Description
Plain of despair was once an ancient battlefield where those brave spirits had rested in peace for thousands of years. Actually no one dare step into this sacred land until the rumor that “there is a huge gold mine underneath the plain” started to spread. Recently an accident destroyed the eternal tranquility. Some greedy fools tried using powerful bombs to find the hidden treasure. Of course they failed and such behavior enraged those spirits--the consequence is that all the human villages nearby are haunted by ghosts.In order to stop those ghosts as soon as possible, Panda the Archmage and Facer the great architect figure out a nice plan. Since the plain can be represented as grids of N rows and M columns, the plan is that we choose ONLY ONE cell in EACH ROW to build a magic tower so that each tower can use holy light to protect the entire ROW, and finally the whole plain can be covered and all spirits can rest in peace again. It will cost different time to build up a magic tower in different cells. The target is to minimize the total time of building all N towers, one in each row.“Ah, we might have some difficulties.” said Panda, “In order to control the towers correctly, we must guarantee that every two towers in two consecutive rows share a common magic area.”“What?”“Specifically, if we build a tower in cell (i,j) and another tower in cell (i+1,k), then we shall have |j-k|≤f(i,j)+f(i+1,k). Here, f(i,j) means the scale of magic flow in cell (i,j).”“How?”“Ur, I forgot that you cannot sense the magic power. Here is a map which shows the scale of magic flows in each cell. And remember that the constraint holds for every two consecutive rows.”“Understood.”“Excellent! Let’s get started!”Would you mind helping them?
?
Input
There are multip
您可能关注的文档
最近下载
- 一种连续性混杂型废塑料无害化热解处置系统及处置方法.pdf VIP
- 糖画介绍课件.pptx VIP
- 湘教版八年级地理下册6.1《 东北地区的地理位置与自然环境》优质教案.docx
- 变态心理学(新教材).pdf VIP
- 农村饮水安全项目社会稳定风险评估与风险防控技术研究报告.docx
- 高三数学三角函数一轮复习.doc VIP
- 施工现场管理机构设置及职责.docx VIP
- 全真派道士申请书.docx VIP
- Panasonic松下 洗衣机 XQG100-V198,XQG100-V19M,XQG100-V19S,XQG100-L186,XQG100-L187,XQG100-L18M,XQG100-L188,XQG100-L18R,XQG100-L18S,XQG100-L1KR,XQG100-3X0R,XQG100-L18T 用户手册.pdf
- 心理健康热线接听操作指南.docx VIP
原创力文档

文档评论(0)