CF488C Fight the Monster
来源:互联网 发布:网络教研总结 编辑:程序博客网 时间:2024/05/20 16:35
题目链接:http://codeforces.com/contest/488/problem/C
题意:
给出
勇士的血量,攻击力,防御力
恶魔的血量,攻击力,防御力
给出提升血量,攻击力,防御力的单价
求打到恶魔的最小花费
所有数字不超过100
思路:
特别简单,枚举攻击力最多到220和防御力最多到110,然后看血,缺多少血买多少即可,更新最小话费
坑:
没有
#include<bits/stdc++.h>#define eps 1e-9#define FOR(i,j,k) for(int i=j;i<=k;i++)using namespace std;typedef long long LL;int i,j,k,n,m,x,T,ans,big,cas,hy,ay,dy,hm,am,dm,h,a,d,m_hp,y_hp,times,myhp,money;bool flag;int main(){scanf("%d%d%d",&hy,&ay,&dy);scanf("%d%d%d",&hm,&am,&dm);scanf("%d%d%d",&h,&a,&d);ans=1<<30;for (i=max(ay,dm+1);i<=220;i++){for (j=dy;j<=110;j++){m_hp=max(0,i-dm);y_hp=max(0,am-j);times=ceil(hm*1.0/m_hp);myhp=times*(y_hp);money=max(myhp-hy+1,0)*h+(i-ay)*a+(j-dy)*d;ans=min(ans,money);}}printf("%d\n",ans); return 0;}
0 0
- CF488C Fight the Monster
- CF_487A Fight the Monster(二分)
- Fight the Monster题解报告
- codeforces 487A Fight the Monster
- 【Codeforces】 487A Fight the Monster
- CodeForces 487A Fight the Monster
- codeforces #487A# Fight the Monster(枚举)
- Codeforces 487A Fight the Monster(暴力)
- Codeforces 487A Fight the Monster
- Codeforces Round #278 (Div. 2) 488C.Fight the Monster
- Codeforces 488 C. Fight the Monster(模拟)
- Codeforces Round #278 (Div. 2) C. Fight the Monster(暴力)
- codeforces 488C Fight the Monster(枚举)
- codeforces 487 A Fight the Monster 暴力枚举
- Codeforces 488C Fight the Monster【二分+枚举】
- CodeForces 488 C.Fight the Monster(枚举)
- Codeforces Round #278 (Div. 2) C. Fight the Monster 二分+枚举
- Codeforces Round #278 (Div. 1) A. Fight the Monster( 暴力)
- uva10273(暴力模拟)
- 解决Ubuntu系统中文乱码显示问题
- VC小技巧20个
- Redis主从复制
- World Wind Java开发之四——搭建本地WMS服务器
- CF488C Fight the Monster
- 探索推荐引擎内部的秘密,第 1 部分: 推荐引擎初探
- 关键字this与super
- poj3279开关问题
- Lane-CentOS7(2)-安装LAMP作为Web服务
- VS2008远程调试简介
- Animation之View Animation
- vi 多行添加注释,删除注释,多行操作
- 汇编语言中寄存器的作用