山东第7届省赛 J题 Execution of Paladin
2016-06-10 19:50
309 查看
没玩过炉石,不想看这题,做的太晚了,应该早点做的。
7 Murlocs.
![](http://acm.sdut.edu.cn/image/3569_1.png)
There are many different minions in Murloc race, here are four of them:
Coldlight Oracle: 3 MANA, 2 ATTACK, 2 HP. Battlecry: Each player draws 2 cards.
Murloc Warleader: 3 MANA, 3 ATTACK, 3 HP. ALL other Murlocs have +2/+1.
Bluegill Warrior: 2 MANA, 2 ATTACK, 3 HP. Charge.
Old Murk-Eye: 4 MANA, 2 ATTACK, 3 HP. Charge. Has +1 Attack for each other Murloc on the Battlefield.
![](http://acm.sdut.edu.cn/image/3569_2.png)
Here are some explanations:
MANA: The cost of summon the minion. Minions summoned by ability cards cost no mana besides the cost of the ability cards. Every player has 10 MANAs at most.
ATTACK: How many damage can the minion make once.
HP: How many attacks can the minion or heroes take.
Battlecry: An ability where a particular effect activates when the card with the Battlecry is played directly from the hand. The minions summoned by ability won’t activate their Battlecry.
Charge: Minions cannot attack at once when they are summoned unless they have Charge description. They will have to wait until next turn.
Battlefield: The battlefield (or game board) is where the action takes place, representing the board on which each game is played out.
+2/+1: +2 ATTACK and +1 HP.
Now, it is your turn. You have 10 MANAs and only one card: Anyfin Can Happen. There are nothing on the Battlefield, which means your minions can directly attack enemy hero. You can remember the list of dead Murlocs. You know how many HP the enemy hero remains.
Will you win this game through this only card you have?
The first line of each test contains two integers, n (the number of dead Murlocs, 0 <= n <= 7) and h (the HP of enemy hero, 0 < h <= 30).
Then n lines follows, each line contains a string, indicates the name of dead Murloc. The string will only be “Coldlight Oracle”, “Murloc Warleader”, “Bluegill Warrior” or “Old Murk-Eye”.
and make his/her HP less or equal than 0.
In the second test case, every Old Murk-Eye has +2 ATTACK because there is another Old Murk-Eye and a Coldlight Oracle. So the total damage is 8.
In the last test case, Old Murk-Eye has 12 ATTACK (2 basic ATTACK, 6 other Murlocs and 2 Murloc Warleader), two Bluegill Warriors has 6 ATTACK(2
basic ATTACK, and 2 Murloc Warleader) each. So the total damage is 24.
ACcode:
#include <bits/stdc++.h>
#define maxn 1500+1
using namespace std;
char name[maxn];
int add[maxn];
int main()
{
int t,n,h;
cin>>t;
while(t--){
cin>>n>>h;
getchar();
int qq=0;
memset(add,0,sizeof(add));
for(int i=1;i<=n;++i){
gets(name);
if(name[0]=='C')add[i]=0;
if(name[0]=='M')qq++,add[i]=0;
if(name[0]=='O')add[i]=2+n-1;
if(name[0]=='B')add[i]=2;
}
int ans=0;
for(int i=1;i<=n;++i){
if(add[i])add[i]+=2*qq;
ans+=add[i];
}
if(ans>=h)
puts("Mrghllghghllghg!");
else
puts("Tell you a joke, the execution of Paladin.");
}
return 0;
}
Execution of Paladin
Time Limit: 2000MS Memory limit: 65536K
题目描述
Murloc is a powerful race in Hearthstone. In the set League of Explorers, a new Paladin ability card called Anyfin Can Happen is released with the ability to summon 7 Murlocs that died this game. If there aren’t enough dead Murlocs, it may summon less than7 Murlocs.
![](http://acm.sdut.edu.cn/image/3569_1.png)
There are many different minions in Murloc race, here are four of them:
Coldlight Oracle: 3 MANA, 2 ATTACK, 2 HP. Battlecry: Each player draws 2 cards.
Murloc Warleader: 3 MANA, 3 ATTACK, 3 HP. ALL other Murlocs have +2/+1.
Bluegill Warrior: 2 MANA, 2 ATTACK, 3 HP. Charge.
Old Murk-Eye: 4 MANA, 2 ATTACK, 3 HP. Charge. Has +1 Attack for each other Murloc on the Battlefield.
![](http://acm.sdut.edu.cn/image/3569_2.png)
Here are some explanations:
MANA: The cost of summon the minion. Minions summoned by ability cards cost no mana besides the cost of the ability cards. Every player has 10 MANAs at most.
ATTACK: How many damage can the minion make once.
HP: How many attacks can the minion or heroes take.
Battlecry: An ability where a particular effect activates when the card with the Battlecry is played directly from the hand. The minions summoned by ability won’t activate their Battlecry.
Charge: Minions cannot attack at once when they are summoned unless they have Charge description. They will have to wait until next turn.
Battlefield: The battlefield (or game board) is where the action takes place, representing the board on which each game is played out.
+2/+1: +2 ATTACK and +1 HP.
Now, it is your turn. You have 10 MANAs and only one card: Anyfin Can Happen. There are nothing on the Battlefield, which means your minions can directly attack enemy hero. You can remember the list of dead Murlocs. You know how many HP the enemy hero remains.
Will you win this game through this only card you have?
输入
Multiple test cases. The first line contains an integer T (T<= 22000), indicating the number of test case.The first line of each test contains two integers, n (the number of dead Murlocs, 0 <= n <= 7) and h (the HP of enemy hero, 0 < h <= 30).
Then n lines follows, each line contains a string, indicates the name of dead Murloc. The string will only be “Coldlight Oracle”, “Murloc Warleader”, “Bluegill Warrior” or “Old Murk-Eye”.
输出
One line per case. If you can win the game in this turn, output “Mrghllghghllghg!”(Without quotes). Otherwise, output “Tell you a joke, the execution of Paladin.” You will win the game if you attack enemy hero with your minionsand make his/her HP less or equal than 0.
示例输入
3
3 1
Coldlight Oracle
Coldlight Oracle
Murloc Warleader
3 8
Old Murk-EyeOld
Murk-EyeColdlight
Oracle
7 30
Old Murk-Eye
Bluegill Warrior
Bluegill Warrior
Murloc Warleader
Murloc Warleader
Coldlight Oracle
Coldlight Oracle
示例输出
Tell you a joke, the execution of Paladin.
Mrghllghghllghg!
Tell you a joke, the execution of Paladin.
提示
In the first test case, none of the Murlocs can attack.In the second test case, every Old Murk-Eye has +2 ATTACK because there is another Old Murk-Eye and a Coldlight Oracle. So the total damage is 8.
In the last test case, Old Murk-Eye has 12 ATTACK (2 basic ATTACK, 6 other Murlocs and 2 Murloc Warleader), two Bluegill Warriors has 6 ATTACK(2
basic ATTACK, and 2 Murloc Warleader) each. So the total damage is 24.
来源
“浪潮杯”山东省第七届ACM大学生程序设计竞赛示例程序
ACcode:
#include <bits/stdc++.h>
#define maxn 1500+1
using namespace std;
char name[maxn];
int add[maxn];
int main()
{
int t,n,h;
cin>>t;
while(t--){
cin>>n>>h;
getchar();
int qq=0;
memset(add,0,sizeof(add));
for(int i=1;i<=n;++i){
gets(name);
if(name[0]=='C')add[i]=0;
if(name[0]=='M')qq++,add[i]=0;
if(name[0]=='O')add[i]=2+n-1;
if(name[0]=='B')add[i]=2;
}
int ans=0;
for(int i=1;i<=n;++i){
if(add[i])add[i]+=2*qq;
ans+=add[i];
}
if(ans>=h)
puts("Mrghllghghllghg!");
else
puts("Tell you a joke, the execution of Paladin.");
}
return 0;
}
相关文章推荐
- LaTeX在双栏模式下插入跨栏图表
- Run Loops 是个什么东西。
- sortable图片拖拽插件
- 负载均衡lvs搭建方案
- 没有被调用的函数其代码为什么会被执行?
- 斜杠/和反斜杠\的区别
- gcc编译警告
- Hadoop:Hadoop单机伪分布式的安装和配置
- 数据结构与算法之五 链接列表
- 数据结构与算法之五 链接列表
- 数据结构与算法之五 链接列表
- Hadoop:Hadoop单机伪分布式的安装和配置
- MySQL导入CSV文件
- jquery动画中显示、隐藏
- UVA 11584 Partitioning by Palindromes
- ?super T 和? extends T区别
- phpMyadmin
- NullPointerException异常的原因及java异常??
- 实现char*和CString的转换
- Metal着色语言编程指南 二五