题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5115 题目大意:前面有n头狼并列排成一排, 每一头狼都有两个属性--基础攻击力和buff加成, 每一头狼的攻击力等于他自身的基础攻击力加上旁边狼对他的buff加成. 现在你被这群狼围着了, 必须将这些狼全部击败, 你才能逃出, 你每攻击一头狼,收到的伤害是狼的总攻击力.现在问,你逃出这些狼的围攻需要的最小代价(收到的伤害): 解题思路:声明dp数组, dp[i][j]代表从i到j的区间杀死所有狼的最…
A Curious Matt Time Limit: 2000/2000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 3058    Accepted Submission(s): 1716 Problem Description There is a curious man called Matt. One day, Matt's best friend Ted is w…
题目传送门 设dp[i][j]为杀掉区间i到j之间的狼需要付出的最小代价,那么dp[i][j]=min{dp[i][k-1]+dp[k+1][j]+a[k]+b[i-1]+b[j+1]} Java代码 import java.io.*; import java.util.*; class MyInputStream extends InputStream { public BufferedInputStream bis = new BufferedInputStream(System.in);…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5113 题目大意:有k种颜色的方块,每种颜色有ai个, 现在有n*m的矩阵, 问这k种颜色的方块能否使任意两个相连的方块颜色不一样填满整个矩阵,如果可以输出任意一种. 解题思路:由于n,m在[1, 5]内, 所以直接暴力枚举: 需要注意的是:需要剪枝一下. 代码如下: #include<stdio.h> #include<string.h> #include<cmath> #…
传送门 对于错想成lis的解法,提供一组反例 1 3 4 2 5同时对于这次案例也可以观察出解法:对于每一个数,如果存在比它小的数在它后面,它势必需要移动,因为只能小的数无法向右移动,而且每一次移动都必然可以使得这个数到达正确位置,这是根据题意而得的 #include<queue> #include<cmath> #include<cstdio> #include<cstring> #include<cstdlib> #include<io…
A http://acm.hdu.edu.cn/showproblem.php?pid=5112 输入n个时刻和位置,问那两个时刻间速度最快. 解法:按照时间排序,然后依次求相邻两个之间的速度,速度=ds/dt #include<cstdio> #include<algorithm> using namespace std; ; struct G{ int t,x; friend bool operator <(const G &a,const G &b){…
本题解不包括个人觉得太水的题(J题本人偷懒没做). 个人觉得这场其实HDU-5116要比HDU-5118难,不过赛场情况似乎不是这样.怀疑是因为老司机带错了路. 这套题,个人感觉动态规划和数论是两个主要的考点. HDU 5113 Black And White HDU 5114 Collision HDU 5116 Everlasting L HDU 5117 Fluorescent HDU 5118 GRE Words Once More!…
1001  A Curious Matt 求一段时间内的速度单位时间变化量,其实就是直接求出单位时间内的,如果某段时间能达到最大那么这段时间内必定有一个或一小段单位时间内速度变化是最大的即局部能达到最大,比较水就是格式上有点坑,谜之wa了好几发 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <algorithm> #inc…
Problem Description Dire wolves, also known as Dark wolves, are extraordinarily large and powerful wolves. Many, if not all, Dire Wolves appear to originate from Draenor. Dire wolves look like normal wolves, but these creatures are of nearly twice th…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5115 Dire Wolf Time Limit: 5000/5000 MS (Java/Others)Memory Limit: 512000/512000 K (Java/Others) 问题描述 Dire wolves, also known as Dark wolves, are extraordinarily large and powerful wolves. Many, if not…