【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的长方形去填格子的空缺; 如果有填满的方案且方案 ...
随机推荐
- [RK3288][Android6.0] U-boot 启动流程小结【转】
本文转载自:http://blog.csdn.net/kris_fei/article/details/52536093 Platform: RK3288OS: Android 6.0Version: ...
- Java 8 实战 P1 Fundamentals
目录 Chapter 1. Java 8: why should you care? Chapter 2. Passing code with behavior parameterization Ch ...
- bzoj1143(2718)[CTSC2008]祭祀river(最长反链)
1143: [CTSC2008]祭祀river Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 2781 Solved: 1420[Submit][S ...
- HTML 14 JS事件
一 :什么是事件 发生的某一件事:触发特定的条件,完成某一项功能 二:学习的目的 在特定的条件下,完成特定的功能 条件满足的情况下,系统会自动执行 ( 回调 ) 绑定的方法 学习要点: 1.事件的两种 ...
- c#,Java aes加密
1.c#版本 /// <summary> /// Aes加密解密.c#版 /// </summary> public class BjfxEncryptHelper { /// ...
- G - Wrong Subtraction
Problem description Little girl Tanya is learning how to decrease a number by one, but she does it w ...
- jquery.validate验证text,checkbox,radio,selected
index.cshtml <form id="formLogin" method="post"> <div> <label for ...
- 《CSS Mastery》 读书笔记 (1)
--本笔记中英混合,专业名词尽量不翻译,免得误解,如果不习惯,就不用往下看了,走好不送. 第一章 基础 人类的好奇心总是促使我们捣鼓,捣鼓是最好做有效的学习CSS的方法 In this chapter ...
- css2.0文档查阅及字体样式
css2.0文档查阅下载 网址:http://soft.hao123.com/soft/appid/9517.html <html xmlns="http://www.w3.o ...
- 【MySQL】通信协议
1.TCP/IP(Transmission Control Protocol/Internet Protocol) 该通信协议套件用于连接 Internet 上的主机.在 Linux 操作系统中,TC ...