HDU 4950 Monster】的更多相关文章

HDU 4950 Monster 题目链接 题意:给定怪兽血量h,你攻击力a.怪物回血力b,你攻击k次要歇息一次,问是否能杀死怪兽 思路:签到题,注意最后一下假设打死了怪,那么怪就不会回血了 思路: #include <cstdio> #include <cstring> typedef long long ll; ll h, a, b, k; bool solve() { if (a >= h) return true; if (b >= a) return fals…
题目链接:pid=4950http://acm.hdu.edu.cn/showproblem.php?pid=4950">http://acm.hdu.edu.cn/showproblem.php?pid=4950 Monster Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 220    Accepted Submission…
Monster 题目链接: http://acm.hust.edu.cn/vjudge/contest/123554#problem/I Description Teacher Mai has a kingdom. A monster has invaded this kingdom, and Teacher Mai wants to kill it. Monster initially has h HP. And it will die if HP is less than 1. Teache…
题目链接 题意:有一个怪物的血量为h,人攻击怪物,每回合可以杀掉a滴血,再回b滴血,k个回合之后人会休息一回合,即人不攻击而怪物回b滴血,问能否杀死.翻译过来就是给定一个数h,每轮可以先减a再加b,k轮后会有一轮只加b不减a,如果再这过程中存在h<=0就输出YES,否则输出NO. 题解:注意是先减a再加b,有可能不加b就已经h<=0,先分类讨论ab,如果a>b,那么只有可能第一回合杀死,一旦+b就不可能在杀死了,如果a<=b,讨论在经过k-1轮后第k轮只减不加能否<=0,再讨…
http://acm.hdu.edu.cn/showproblem.php?pid=4950 给定怪兽血量h,你攻击力a,怪物回血力b,你攻击k次要休息一次,问能否杀死怪兽 特判一次打死怪兽的情况和第k次前打死怪兽的情况,否则只要能磨死怪兽即可 #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <string> #include &l…
Monster Time Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1383    Accepted Submission(s): 363 Problem Description One day, v11 encounters a group of monsters in a foreast. In order to defend the…
#include<stdio.h> int main(){ __int64 h,a,b,k,j=0; while(scanf("%I64d%I64d%I64d%I64d",&h,&a,&b,&k),h||a||b||k) { printf("Case #%I64d: ",++j); if(h<a+1) { printf("YES\n"); continue; } if(a<=b) { pri…
4950 Monster Monster Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 52 Accepted Submission(s): 29 Problem Description Teacher Mai has a kingdom. A monster has invaded this kingdom, and Teacher Mai…
主题链接:HDU 2616 Kill the monster 意甲冠军:有N技能比赛HP有M怪物,技能(A,M),能伤害为A.当怪兽HP<=M时伤害为2*A. 求打死怪兽(HP<=0)用的最少技能 方法一:将技能全排列.计算伤害.得到答案. 方法二:搜索,详细看代码. 全排列AC代码: #include<stdio.h> #include<algorithm> using namespace std; struct node { int p,v; }; struct n…
一.题意 给定一个树状地图,每个树节点上有一只怪物,打死一只怪物的过程中将会消耗A点HP,打死之后将会获得B点HP.因为树状结构,所以每只怪物必须先打死父节点的怪兽之后在打死子节点的怪物.现在,给定每只怪兽的a,b和树状结构的联通关系,求初始HP最小的击败顺序. Little Q is fighting against scary monsters in the game ``Monster Hunter''. The battlefield consists of n intersection…