【Codeforces 903B】The Modcrab
【链接】 我是链接,点我呀:)
【题意】
【题解】
显然如果对方一次攻击能打死你。
那么你不能对他攻击了。必须加血。其他时候都只要攻击就可以了。
但也不一定非得加血。
因为有时候可以“绝杀”,就是虽然对方能打死你,但你也能在这回合打死对方。
这种情况就不用加血了。
【代码】
#include <bits/stdc++.h>
using namespace std;
int h1,a1,c1;
int h2,a2;
vector<string> ans;
int main()
{
ios::sync_with_stdio(0),cin.tie(0);
cin >> h1 >> a1 >> c1;
cin >> h2 >> a2;
while (h2>0){
if (h1<=a2){
if (h2-a1<=0){
h2-=a1;
ans.push_back("STRIKE");
}else{
h1+=c1;
ans.push_back("HEAL");
}
}else{
ans.push_back("STRIKE");
h2-=a1;
}
if (h2<=0) break;
h1-=a2;
}
cout<<ans.size()<<endl;
for (string x:ans){
cout<<x<<endl;
}
return 0;
}
【Codeforces 903B】The Modcrab的更多相关文章
- 【codeforces 415D】Mashmokh and ACM(普通dp)
[codeforces 415D]Mashmokh and ACM 题意:美丽数列定义:对于数列中的每一个i都满足:arr[i+1]%arr[i]==0 输入n,k(1<=n,k<=200 ...
- 【codeforces 707E】Garlands
[题目链接]:http://codeforces.com/contest/707/problem/E [题意] 给你一个n*m的方阵; 里面有k个联通块; 这k个联通块,每个连通块里面都是灯; 给你q ...
- 【codeforces 707C】Pythagorean Triples
[题目链接]:http://codeforces.com/contest/707/problem/C [题意] 给你一个数字n; 问你这个数字是不是某个三角形的一条边; 如果是让你输出另外两条边的大小 ...
- 【codeforces 709D】Recover the String
[题目链接]:http://codeforces.com/problemset/problem/709/D [题意] 给你一个序列; 给出01子列和10子列和00子列以及11子列的个数; 然后让你输出 ...
- 【codeforces 709B】Checkpoints
[题目链接]:http://codeforces.com/contest/709/problem/B [题意] 让你从起点开始走过n-1个点(至少n-1个) 问你最少走多远; [题解] 肯定不多走啊; ...
- 【codeforces 709C】Letters Cyclic Shift
[题目链接]:http://codeforces.com/contest/709/problem/C [题意] 让你改变一个字符串的子集(连续的一段); ->这一段的每个字符的字母都变成之前的一 ...
- 【Codeforces 429D】 Tricky Function
[题目链接] http://codeforces.com/problemset/problem/429/D [算法] 令Si = A1 + A2 + ... + Ai(A的前缀和) 则g(i,j) = ...
- 【Codeforces 670C】 Cinema
[题目链接] http://codeforces.com/contest/670/problem/C [算法] 离散化 [代码] #include<bits/stdc++.h> using ...
- 【codeforces 515D】Drazil and Tiles
[题目链接]:http://codeforces.com/contest/515/problem/D [题意] 给你一个n*m的格子; 然后让你用1*2的长方形去填格子的空缺; 如果有填满的方案且方案 ...
随机推荐
- android 细节之 menu 之 invalidateOptionsMenu
menu 在 android中是个很经常使用的控件,曾经自己做项目的时候通常都是将系统的menu相关方法在activity中直接删去.而且将主题换为fullscreen,然后再在layout中引入自己 ...
- Codeforces Round #250 Div. 2(C.The Child and Toy)
题目例如以下: C. The Child and Toy time limit per test 1 second memory limit per test 256 megabytes input ...
- OTA升级中关于update.zip包的一些总结【转】
本文转载自:http://429564140.iteye.com/blog/2337165 update.zip包整理 一. update.zip包的目录结构 |----boot. ...
- How to use shared model by git in sql source control of red gate
1.clone the git repository for datbase 2.open sql source control window and select the target databa ...
- wesome-android
awesome-android Introduction android libs from github System requirements Android Notice If the lib ...
- bzoj 3231 [ Sdoi 2008 ] 递归数列 —— 矩阵乘法
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3231 裸矩阵乘法. 代码如下: #include<iostream> #incl ...
- operator[] 重载
#include <iostream>#include <vector>#include <string> class Assoc { struct Pair ...
- Rabbit--ack机制
消息应答时执行一个任务可能需要花费几秒钟,你可能会担心如果一个消费者在执行任务过程中挂掉了. 一旦RabbitMQ将消息分发给了消费者,就会从内存中删除.在这种情况下,如果正在执行任务的消费者宕机,会 ...
- YOLO (You Only Look Once)
YOLO (You Only Look Once) dl cnn object detection 一.YOLO YOLO是一个实时的目标检测系统.最新的V2版本在Titan X 上可以每秒处理 ...
- YOLO训练Pedestrain
Pedestrain dl 使用darknet训练: 1. Inria 创建 yolo-inria.cfg 从cfg/yolo-voc.2.0.cfg拷贝一份,修改batch=64, subdivi ...