ZOJ 3868 - Earthstone: Easy Version
Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld
& %llu
Description
Earthstone is a famous online card game created by Lizard Entertainment. It is a collectible card game that revolves around turn-based matches between two opponents. Players start the game with a substantial collection of basic cards, but
can gain rarer and more powerful cards through purchasing packs of additional cards, or as rewards for competing in the arena. Card packs can be purchased with gold, an in-game currency rewarded for completing random daily quests and winning matches, or by
using real money in the in-game store.
Each Earthstone battle is a one on one turn-based match between two opponents. During a player's turn, he can choose to play any of his cards and command the minions to attack targets. Those played cards will be placed on the table as they are 'summoned'
as minions. Each card has two basic attributes:
- Attack Ai: If a minion attacks a character or was attacked, it will deal Ai points of damage to the opponent. A character whose attack value is zero cannot actively attack.
- Health Hi: The minion has Hi points of initial health. After being damaged, the minion's health will decrease by the corresponding damage value. The minion will be killed and discarded if its health is less than
or equal to zero.If a minion attacks another minion, both of them will receive damage simultaneously.
Given two minions, please calculate the result if the first minion attacked the second one.
Input
There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:
There are four integers A1, H1, A2 and H2 (0 <= A1, A2 <=10, 1 <= H1, H2 <= 10),
which are the attributes of two minions.
Output
For each test case, output "Invalid" (without quotes) if the first minion cannot attack, otherwise output the minions attributes as the format in input. If the minion is killed, output "Discard" instead (without quotes).
Sample Input
3 3 3 2 4 3 2 2 5 0 3 2 2
Sample Output
3 1 2 1 Discard 2 2 Invalid
似乎看到了熟悉的游戏……飘过~
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <algorithm>
typedef long long LL;
using namespace std;
int main()
{
int T,a1,h1,a2,h2;
cin>>T;
while(T--)
{
cin>>a1>>h1>>a2>>h2;
if(a1==0)
{
cout<<"Invalid"<<endl;
continue;
}
h1-=a2;
h2-=a1;
if(h1<=0) cout<<"Discard"<<" ";
else cout<<a1<<" "<<h1<<" ";
if(h2<=0) cout<<"Discard"<<endl;
else cout<<a2<<" "<<h2<<endl;
}
return 0;
}
ZOJ 3868 - Earthstone: Easy Version的更多相关文章
- Ping-Pong (Easy Version)(DFS)
B. Ping-Pong (Easy Version) time limit per test 2 seconds memory limit per test 256 megabytes input ...
- Codeforces 1077F1 Pictures with Kittens (easy version)(DP)
题目链接:Pictures with Kittens (easy version) 题意:给定n长度的数字序列ai,求从中选出x个满足任意k长度区间都至少有一个被选到的最大和. 题解:$dp[i][j ...
- UVA12569-Planning mobile robot on Tree (EASY Version)(BFS+状态压缩)
Problem UVA12569-Planning mobile robot on Tree (EASY Version) Accept:138 Submit:686 Time Limit: 300 ...
- Coffee and Coursework (Easy version)
Coffee and Coursework (Easy version) time limit per test 1 second memory limit per test 256 megabyte ...
- 2016级算法第六次上机-B.ModricWang's FFT : EASY VERSION
1114 ModricWang's FFT EASY VERSION 思路 利用FFT做大整数乘法,实际上是把大整数变成多项式,然后做多项式乘法. 例如,对于\(1234\),改写成\(f(x)=1* ...
- Saving James Bond - Easy Version (MOOC)
06-图2 Saving James Bond - Easy Version (25 分) This time let us consider the situation in the movie & ...
- Codeforces Round #540 (Div. 3) F1. Tree Cutting (Easy Version) 【DFS】
任意门:http://codeforces.com/contest/1118/problem/F1 F1. Tree Cutting (Easy Version) time limit per tes ...
- Codeforces Round #540 (Div. 3) D1. Coffee and Coursework (Easy version) 【贪心】
任意门:http://codeforces.com/contest/1118/problem/D1 D1. Coffee and Coursework (Easy version) time limi ...
- Codeforces Round #521 (Div. 3) F1. Pictures with Kittens (easy version)
F1. Pictures with Kittens (easy version) 题目链接:https://codeforces.com/contest/1077/problem/F1 题意: 给出n ...
随机推荐
- Java基础之一组有用的类——使用比较器对数组排序(TrySortingWithComparator)
控制台程序. Arrays类中的sort()静态方法把传送为参数的数组元素按升序方式排序. 对于第一个参数类型是Object[]的sort()方法来说,可以传送任意类型的数组.如果使用sort()方法 ...
- SQLSERVER:通过sys.tables实现批量删表、快速统计多表记录和
SQLSERVER:通过sys.tables实现批量删表,或者回滚表 begin try drop table #temp10 end try begin catch end catch select ...
- Java I/O解读与使用实例
林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka 摘要:本文主要讲解了Java I/O解读与使用实例. 一.I/O基本概念 I/O全称是Inpu ...
- t4 multiple output sample
<#@ output extension=".js" #> <#@ template debug="false" hostspecific=& ...
- C# Enum Type
class Program { public enum TimeOfDay { Morining, Afternoon, Evening } static void Main(string[] arg ...
- Eclipse安装Ruby插件应该注意的几点
http://www.aptana.com/products/studio3/success_plugin.html Installing via Eclipse Please copy the fo ...
- 五种常见的电子商务模式对比:B2B、B2C、C2B、C2C、O2O
电子商务模式是指企业运用互联网开展经营取得营业收入的基本方式,也就是指在网络环境中基于一定技术基础的商务运作方式和盈利模式.目前,常见的电子商务模式主要有B2B.B2C.C2B.C2C.O2O等几种, ...
- bzoj1834 [ZJOI2010]network 网络扩容
第一问跑最大流,第二问新建一条边连接0和1,流量为上第一问的答案+k,费用为0,接下来图中每条边拆成两条边,第一条容量为C费用为0,第二条容量无穷费用为W,再跑一遍费用流即可. 代码 #include ...
- apache高负载性能调优
先阅读apache配置优化建议如下,再对相关参数进行调整,观察服务器状况.Apache配置优化建议:进入/usr/local/apache2/conf/extra 目录下Apache优化,经过上述操作 ...
- angular Creating a Directive that Adds Event Listeners
<span my-draggable>Drag ME</span> angular.module('dragModule', []) .directive('myDraggab ...