博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HZAU1098: Yifan and War3(区间dp)
阅读量:6264 次
发布时间:2019-06-22

本文共 1601 字,大约阅读时间需要 5 分钟。

Time Limit: 3 Sec  
Memory Limit: 128 MB
Submit: 622  
Solved: 20
[ ][ ][ ]

Description

As we all know, There is a hero called Priestess of the Moon(POM), which has a
passive ability named 
Trueshot Aura
. It can add other units some ranged attacks . Fanfan love the Human very much, and he will battle with a Night Elf everyday , because he thinks the Night Elf can’t attack his tower easily .But today , he met a Night Elf player , who use POM as his first hero, and had lots of Archers . Fanfan use the
Mountain King to kill the Archers ,and don’t know how many health he need to kill all the Archers .Could you help him ?
        To make the problem simple , we assume that all the Archers stand in a line , they have different attacks , if Fanfan kills the ith Archer , the (i+1)th and the (i-1)th Archer will help to attack Fanan by their own attacks . There are N Archers , and Fanfan wants to know the least damage he will get to kill all the Archers .

Input

First line contains an integer N (0<N<200), means there are N Archers .
Then the next line contains N integers ai(0<ai<100000) means that the ith Archers have ai attacks . 

Output

An integer means the least damage Fanfan will get.

Sample Input

310 100 10

Sample Output

150

HINT

Yifan first kill the second Archer , get 100+10+10 demages , and then kill the first one ,get 10+10 demages and finally kill the third one and get 10 demages so , he get 150 demage

看了其他人的思路整理出来。相似题目:POJ1651:Multiplication Puzzle
# include 
# include
int min(int a, int b){ return a

转载于:https://www.cnblogs.com/junior19/p/6730118.html

你可能感兴趣的文章
tkinter 创建登陆注册界面
查看>>
linux常用命令
查看>>
决策树-流水线
查看>>
linux系统被黑客入侵排查思路
查看>>
个人中心标签页导航
查看>>
如何刻录XP系统盘
查看>>
nios II--实验4——按键中断硬件部分
查看>>
pycharm多行批量缩进和反向缩进快捷键
查看>>
设计模式——外观模式(Facade)
查看>>
Sublime Text 2 使用心得
查看>>
SQLite数据库查询优化
查看>>
UIViewController各个方法的加载顺序
查看>>
Jenkins新建节点,启动方式没有“通过Java Web启动代理”选项怎么办?
查看>>
iOS html格式解析
查看>>
软件工程实践2017第一次作业
查看>>
Homestead 中使用 laravel-mix 问题汇总
查看>>
Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list(self, locator, *items)...
查看>>
GNU/Linux 初学之旅(转)
查看>>
【java】Split函数踩坑记
查看>>
【leetcode】Decode Ways
查看>>