Earthstone: Easy Version
来源:互联网 发布:中国大国沙文主义 知乎 编辑:程序博客网 时间:2024/04/30 00:28
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 dealAi points of damage to the opponent. A character whose attack value is zero cannot actively attack.
- Health Hi: The minion hasHi 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 andH2 (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
33 3 2 43 2 2 50 3 2 2
Sample Output
3 1 2 1Discard 2 2Invalid
#include<stdio.h>int main(){ int t,a,b,c,d; scanf("%d",&t); while(t--) { scanf("%d %d %d %d",&a,&b,&c,&d); if(a<=0) printf("Invalid\n"); else { int p,w; p=b-c; w=d-a; if(p<=0) printf("Discard "); else printf("%d %d ",a,p); if(w<=0) printf("Discard\n"); else printf("%d %d\n",c,w); } } return 0;}
- ZOJ3867:Earthstone: Easy Version
- Earthstone: Easy Version
- ZOJ 3867 Earthstone: Easy Version
- ZOJ 3868 - Earthstone: Easy Version
- Compare Version Numbers----easy
- Saving James Bond - Easy Version
- Saving James Bond - Easy Version
- Saving James Bond - Easy Version
- letcode278[easy]--First Bad Version
- Vim 命令-快捷键 集合(Easy Version)
- 05-2. Saving James Bond - Easy Version
- [Leetcode 165, Easy] Compare Version Numbers
- Codeforces 320B Ping-Pong (Easy Version)
- PAT-Saving James Bond - Easy Version (25)
- Saving James Bond - Easy Version 简单dfs
- CodeForces 320BPing-Pong (Easy Version)-DFS
- 165. Compare Version Numbers [easy] (Python)
- Easy-题目63:278. First Bad Version
- poj-1548-Robots- 贪心+模拟 / 最小路径覆盖
- poj2438 哈密顿图
- think python学习心得-(2)接口设计
- java第九天
- HDOJ 1092 A+B for Input-Output Practice (IV)
- Earthstone: Easy Version
- WEB-laydate兼容bootstrap样式错误
- 解决数据库文件导入时出现的#1046 - No database selected错误。
- 42. Trapping Rain Water
- (problem)SyntaxError: Non-ASCII character '\xe7' in file,but no encoding declared;
- redis 主从复制及切换
- 【考研英语】:单词表1
- Intervals
- 地宫取宝 (DFS+记忆化)