HDU3646Fate Stay Night动态规划DP题解

HDU2059龟兔赛跑-题解动态规划DP 龟兔赛跑<br />Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)<br />Total Submission(s): 3538    Accepted Submission(s): 1277<br /><br />Problem Description据说在很久很久以前,可怜的兔子经历了人生中最大的打击——赛跑输给乌龟后,心中郁闷,发誓要报仇雪恨,于是躲进了杭州下沙某农业园卧薪尝胆潜心修 阅读详情

Fate Stay Night

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 278    Accepted Submission(s): 73

Problem Description
Jack was addicted to a fighting game recently. The game is similar to a famous anime “Fate Stay Night”. In the game, you should control your “servant” Saber to fight another “servant” Berserker.

Berserker is a famous hero who has a lot of lives. In every life, he has some “blood points”. For example, he may have 100 blood points in his first life and 200 blood points in his second life. When Berserker loss all blood points in a life, he is killed. But he will become alive immediately with next life. When there is no next life left, Berserker is really dead and you win.
Saber can attack Berserker for N times. During each attack, Saber releases a fire bird to fight Berserker. Each fire bird has some “power points”.
A fire bird can make Berserker loss blood points. But if Berserker loss one blood point, the fire bird also will loss one power point. When the power points of a fire bird become zero, the fire bird dies.
A living fire bird may be in two statuses:“young”or “old”.
When a fire bird is just released, it is “young”. After it kills Berserker once or more, it becomes“old”.
Let’s suppose a fire bird with remaining n power points fighting Berserker with remaining m blood points in his current life:
If n> m: Berserker will be killed and becomes alive immediately with his next life(if he has), and then the fire bird will be“old”and fight Berserker again with remaining n-m power points.

If n = m: Berserker will be killed and becomes alive with his next life (if he has), and the fire bird dies.

If n < m: In this situation, if the fire bird is “young”, it will die after making Berserker loss n blood points. But if the fire bird is “old”, it just dies without doing any harm to Berserker.

As the “Master” of Saber, you can use “Command Mantra” M times. You can use “Command Mantra”to double a fire bird’s power points, but you can’t use “Command Mantra”more than once on a same fire bird. Now there is the question: How many times can you kill Berserker at most?

 

 

Input
There are several data cases, ended with “0 0 0”
For each test case:
The first line contains three integers N,M,K, meaning the number of attacks of Saber, the times of Command Mantra you can use and the number of lives of Berserker.
The second line contains N integers, indicating the power points of N fire birds, in the order of attacking. You can’t change the attacking order.

The third line contains K integers, meaning the blood points of all Berserker’s lives. The first integer is for his first life, the second integer is for his second life, etc.
Please note: 1<=N<=10000, 0<=M<=100, 0<=K<=100000. All power points and blood points are no more than 10000 and none negative.

 

 

Output
For each test case, output one line containing the maximum times that you can kill Berserker.
 

 

Sample Input
  
10 0 20 8 9 8 7 5 7 5 5 0 2 3 0 2 1 7 1 5 5 7 0 6 1 5 6 7 3 1 0 5 8 10 1 0 6 0 0 7 7 7 1 7 6 7 0 0 0
 

 

Sample Output
  
12 0
 

 

Source
 

 

Recommend
lcy
区域赛杭州网络赛第6题
昨天这题如果AC,我们就有希望晋级现场赛
可是我杯具地把s数组开小了,导致WA
如果返回RE的话我就能发现
WA无数次后也有发现b数组开小了,却忘了改s数组
我实在是蒟蒻!
整个网络赛我们都很杯具,主要是我们实力弱
再加上只有我们三个带领刚进集训队的几个学弟做比赛
老队员都不在
现在只有天津出线了
最后一站福州赛区,老队员回来了,我们压力就应该小些
最后一次机会一定要好好把握!
这道DP其实很简单的
状态:
d[i][j]表示第i只fire Bird使用j次Command Mantra能造成的最大伤害
最后根据最大伤害算出Kill Times
状态转移方程:
d[i][j]=max(d[i-1][j]+w(1),d[i-1][j-1]+w(2));
w(1)表示不使用Command Mantra能造成的最大伤害
w(2)表示使用一次Command Mantra能造成的最大伤害
根据上一次的伤害值算出Berserker处于第几次生命以及剩下的生命值
边界:
d[i][0]=d[i-1][0]+w(1);
代码:
环形m段最大子段和 题解动态规划DP http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=10581环形m段最大子段和Time Limit: 5000ms, Special Time Limit:15000ms, Memory Limit:65536KB Total submit users: 3, Accepted users: 3 Problem 10581 : No special judgementProblem description  我想你已经做出了一维的最大子段 阅读详情

相关推荐

oracle p6 破解版下载,Primavera P6项目管理软件 16~17 图文详细安装教程(附下载)

Primavera P6 Professional项目管理软件结合了Oracle和Microsoft SQL Server关系数据库,是一款非常好用且功能强大的综合的项目管理软件(PPM) 解决方案,主要用于土建等方面的施工计划分析,具有进度时间安排与资源控制功能的多用户、多项目系统,支持多层项目分层结构、角色与技能导向的资源安排、记录实际数据、自定义视图以及自定义数据,本文主要为大家图文详细介绍...

weixin_33978451的博客 4916

hdu3646 Fate Stay Night(dp,读题障碍)

题目大意: 剑客VS狂战士。剑客的招数是依次召唤 N只火鸟攻击(为啥不叫召唤师),火鸟体力不一定相同。而狂战士有 K条命,火鸟一滴血换狂战士一滴血,直到一方体力为0。狂战士体力为0并且还有剩余生命则涅槃重生。火鸟刚招出来是YoungBrid,若杀死过狂战士,则变成OldBrid。剑客可以使用 M次咒语,每次可以使当前火鸟的体力*2。(要求最优状态,则肯定是在刚放出火鸟时施放咒语) 攻击规则:

芒果街上的小屋(此博客暂时停用) 772

Zemax显微镜设计:从物镜到目镜的完整光学系统优化

本文详细介绍了使用Zemax进行显微镜光学系统设计的完整流程,从物镜到目镜的优化技巧。通过实战案例和关键参数设置,帮助读者掌握数值孔径、视场角等核心概念,实现高分辨率显微镜设计。文章特别强调了系统级优化和公差分析的重要性,为科研和工业检测提供可靠的光学解决方案。

weixin_42549451的博客 438

A - Night at the Museum

Description Grigoriy, like the hero of one famous comedy film, found a job as a night security guard at the museum. At first night he received embosser and was to take stock of the whole exposition.Em

YULIU_的博客 609

从0到1搭建StarRocks3.4.1存算一体架构(VM 虚拟机版)

本文详细介绍了如何在VM虚拟机上从零搭建StarRocks 3.4.1存算一体架构。首先阐述了StarRocks作为高性能分布式SQL数据仓库的优势,重点讲解了其存算一体架构的设计原理。随后提供完整的安装指南,包括环境准备(3台CentOS 8虚拟机配置)、网络互通验证、Java环境配置、软件包解压安装等关键步骤。文章特别详细说明了FE和BE节点的配置文件修改(fe.conf和be.conf)以及必要的防火墙端口开放配置。通过图文并茂的方式,帮助开发者和运维人员快速掌握StarRocks集群部署方法,为后续

小 tom的博客 1329

嵌入式开发必备:aarch64-linux-gnu-gcc交叉编译工具链保姆级安装指南(含常见错误解决)

本文详细介绍了aarch64-linux-gnu-gcc交叉编译工具链的安装与配置方法,涵盖从系统软件源安装到Linaro二进制包部署的全流程。针对嵌入式开发中常见的依赖错误、版本冲突等问题提供实用解决方案,并分享性能优化技巧与项目集成经验,帮助开发者高效完成ARM64设备的跨平台开发。

yoga7的博客 1030

hdu 3646 Fate Stay Night

当你题目的一直WA,而且找不到错时,最好的办法是拽一个人来(不管TA懂不懂),把你的想法思路给讲一遍。讲的过程中,你那些自以为是的结论就会站不住脚,你就会反思这样到底对不对,然后差不多就能找出错误来。 对于这道题目:火鸟double后的攻击力肯定比之前强,如果有足够的double,每个火鸟都double 设状态:dp[i][j]表示前i个火鸟使用了j个double消灭最多的敌人数 转移方程:

七里的专栏 772

三大主流交易接口实战指南:XTP、CTP与数字货币API的实盘接入解析

本文深入解析了量化交易系统实现实盘交易的关键环节,聚焦于三大主流交易接口的实战接入。详细介绍了证券领域的XTP、期货领域的CTP以及数字货币交易所API的核心特性、代码封装要点与风控实践,并提供了多市场接口整合的统一架构方案,为开发者打通量化交易的“最后一公里”提供了一份接地气的实战指南。

win55的博客 1376

The 35th ACM/ICPC Asia Regional Hangzhou Site —— Online Contest hdu 3646 Fate Stay Night

原题传送门:http://acm.hdu.edu.cn/showproblem.php?pid=3646 前几天同学老是说我的博客里总说什么简单,水题之类的,他们都看不懂,事实上开始的时候我也不懂,但是明白了之后就觉的自己太傻,好吧,今天的这个题确实不简单!算是比较难的,因为我看了好久,并不是因为同学的说! 这个题的特点是状态为二维,但是每一个状态又必须记录一个量!这个是我第一次做!好吧,我见

水帘洞天 1101

一个完整的c#股票分析软件源码

完整的c#股票分析软件源码

qq_35600909的博客 4595

SSD性能测试进阶:用fio的io_uring引擎榨干你的NVMe硬盘

本文深入探讨了如何利用fio的io_uring引擎对NVMe SSD进行深度性能测试。通过对比传统libaio引擎,详解了io_uring低开销、高并发的优势。文章提供了从测试矩阵设计、队列深度分析到写入放大观察和尾延迟可视化的完整进阶方法,并附有实战案例与脚本,旨在帮助用户科学压榨NVMe硬盘的极限性能,获取更真实的评估数据。

weixin_29247219的博客 326

2010杭州赛区网络预赛 1006 Fate Stay Night (DP)

The 35th ACM/ICPC Asia Regional Hangzhou Site —— Online Contest  1006  Fate Stay Night题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=3646  这里还可以提交这个题主要就是用DP,不过动态方程算是比较难想的 // 1006 mnlm 1.0 #include #include #include #include #include #include using n

mnlm1991的专栏 829

Vibe Coding 实战指南:用 3 类社区资源实现每周高效追新

介绍一种分层技术雷达校准方法,通过领域过滤器(L1技术栈锚定、L2能力映射、L3场景收敛)精准筛选AI编程相关更新,结合可验证的Shell命令与CI任务卡,将信息过载压缩为可执行、可审计的工程实践。

weixin_27251469的博客 330

hdu 2159 FATE 解题报告

链接:http://acm.hdu.edu.cn/showproblem.php?pid=2159 Problem Description 最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到...

weixin_30384031的博客 707

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

POJ 3155 Hard Life 最大密度子图

Hard Life Time Limit: 8000MS   Memory Limit: 65536K Total Submissions: 4345   Accepted: 1226 Case Time Limit: 2000MS

魔神翼 3909

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

HDU 4069 Squiggly Sudoku 数独DLX 福州网络赛

Squiggly Sudoku Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 644 Accepted Submiss

魔神翼 3899

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

HDU 3696 FZU 2006 -- Farm Game SPFA最长路 2010福州区域赛

Farm Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 62768/32768 K (Java/Others) Total Submission(s): 148 Accepted Submission(s): 65 Problem Description “Farm Game” is one of the m

魔神翼 3708

SOJ2113: 数字游戏题解动态规划DP

2113: 数字游戏Submit your solution     Discuss this problem     Best solutionsDescription 【问题描述】 丁丁最近沉迷于一个数字游戏之中。这个游戏看似简单,但丁丁在研究了许多天之后却发觉原来在简单的规则下想要赢得这个游戏并不那么容易。游戏是这样的,在你面前有一圈整数(一共n个),你要按顺序将其分为m个部分,各部分内的数字相加,相加所得的m个结果对10取模后再相乘,最终得到一个数k。游戏的要求是使你所得的k最大或者最小。 例如,对

魔神翼 3589

[SCOI2009]windy数 题解动态规划DP

[SCOI2009]windy数 Time Limit:1000MS  Memory Limit:165536KTotal Submit:162 Accepted:74 Descriptionwindy定义了一种windy数。 不含前导零且相邻两个数字之差至少为2的正整数被称为windy数。 windy想知道,在A和B之间,包括A和B,总共有多少个windy数? Input包含两个整数,A B。 Output一个整数。 Sample Input【输入样例一】 1 10 【输入样例二】 25 50

魔神翼 3430

POJ3662 Telephone Lines 二分+最短路

Telephone Lines Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3468   Accepted: 1245 Description Farmer John wants to set up a telephone line at his farm.

魔神翼 3200

POJ3186Treats for the Cows题解动态规划DP

Treats for the CowsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2686 Accepted: 1280<br />DescriptionFJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day and wan

魔神翼 3032

POJ1651Multiplication Puzzle题解动态规划DP

Multiplication PuzzleTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3460 Accepted: 2034<br />DescriptionThe multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out

魔神翼 2831
上一篇: HDU2441ACM(Array Complicated Manipulation)题解数论
下一篇: 2010ACM-ICPC亚洲区预选赛
power721
博客等级 码龄18年 176粉丝 135原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值