HDU 2809 God of War】的更多相关文章

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2809 题目大意:给出战神吕布的初始攻击力ATI.防御力DEF.生命值HP.每升一级增加的攻击力In_ATI,增加的防御力In_DEF和增加的生命值In_HP.然后给出n个敌人的攻击力.防御力.生命值和杀死该单位能获得的经验值EXP. 吕布的初始经验值EXP是0,初始等级level是1,每当EXP>=level*100时就会升级. 在吕布LvBu和敌人A之间的战斗有3条规则 1.吕布攻击A,A失去 M…
God of War Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1671    Accepted Submission(s): 647   Problem Description At 184~280 A.D ,there were many kingdoms in China. Three strongest among them…
状压DP.我认为是数据水了,用打死了哪几只作为状态,AC代码只需要保存当前状态的最大血量,完全没有考虑攻击力大小. 个人认为正确DP应该这样的:dp[状态][等级],但这样写不能AC,时间复杂度会很大,但答案应该是正确的. #include<cstdio> #include<cstring> #include<cmath> #include<string> #include<algorithm> #include<iostream>…
题目大意:貌似是一个游戏,首先给出卢布的攻击,防御,还有血量,再给出每升一级增加的攻击防御还有血量,然后又N个敌人,杀死每个敌人都会得到一些经验,求杀死完所有敌人时剩余的最大血量. 分析:因为敌人比较少,最多只有20个,所以状态最多有2^20种,用dp[i]表示状态为i的时候的最大剩余血量,然后模拟战斗即可. 代码如下: ========================================================================================…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2809 思路:简单的状压dp,看代码会更明白. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; struct State{ int ati,def,hp,lev,exp; }dp[<<+]; struct Nod…
状态DP. /* 2809 */ #include <iostream> #include <queue> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> using namespace std; #define MAXN 20 typedef struct { int a, d, h, e; } hero_t; hero_t h…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4005 In the war, the intelligence about the enemy is very important. Now, our troop has mastered the situation of the enemy's war zones, and known that these war zones can communicate to each other direc…
http://acm.hdu.edu.cn/showproblem.php?pid=3345 Problem Description War chess is hh's favorite game:In this game, there is an N * M battle map, and every player has his own Moving Val (MV). In each round, every player can move in four directions as lo…
There is a war Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU. Original ID: 2435 64-bit integer IO format: %I64d      Java class name: Main There is a sea.There are N islands in the sea.There are some directional bridges…
HDU 4005 The war pid=4005" target="_blank" style="">题目链接 题意:给一个连通的无向图.每条边有一个炸掉的代价.如今要建一条边(你不不知道的),然后你要求一个你须要的最少代价,保证无论他建在哪,你都能炸掉使得图不连通 思路:炸肯定要炸桥,所以先双连通缩点,得到一棵树,树边是要炸的,那么找一个最小值的边.从该边的两点出发.走的路径中,把两条包括最小值的路径.的两点连边.形成一个环.这个环就保证了最低代…