山东省第七届ACM大学生程序设计竞赛-Execution of Paladin(炉石传说-模拟)

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 than 7 Murlocs.
        

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.


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 minions and make his/her HP less or equal than 0.

示例输入

3
3 1
Coldlight Oracle
Coldlight Oracle
Murloc Warleader
3 8
Old Murk-Eye
Old Murk-Eye
Coldlight 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 12ATTACK (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大学生程序设计竞赛


题目意思:

这题太水……坑在英语上……理一理能用上的信息:

Coldlight Oracle:没用;

Murloc Warleader: 给Bluegill Warrior和Old Murk-Eye,每只加2点攻击;

Bluegill Warrior:加2点攻击;

Old Murk-Eye: 加2点攻击,给除了自身其他所有的每只加一点攻击。


按这个来模拟,给出血量HP,算出攻击值比HP大就胜出,输出 Mrghllghghllghg!;
反之输出 Tell you a joke, the execution of Paladin.

同样,这题也要 注意gets和cin.getline的坑,要先吃掉前面cin的回车。

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
#define MAXN 10001

int main()
{
#ifdef ONLINE_JUDGE
#else
    freopen("G:/x/read.txt","r",stdin);
    freopen("G:/x/out.txt","w",stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t;
    cin>>t;
    while(t--)
    {
        int i,num,hp,sum,n1,n2,n3,n;
        sum=n1=n2=n3=n=0;
        cin>>num>>hp;
        char a[MAXN];
        cin.getline(a,MAXN);
        for(i=0; i<num; ++i)
        {
            char a[MAXN];
            cin.getline(a,MAXN);
            if(a[0] == 'M') n2+=2;
            else if(a[0] == 'B')
            {
                n1+=2;
                ++n;
            }
            else if(a[0] == 'O')
            {
                n1+=2;
                ++n3;
                ++n;
            }
        }
        sum = n2*n+n1+n3*(num-1);
        //cout<<sum<<endl;
        if(sum>=hp) cout<<"Mrghllghghllghg!"<<endl;
        else cout<<"Tell you a joke, the execution of Paladin."<<endl;
    }
    return 0;
}
/*
3
3 1
Coldlight Oracle
Coldlight Oracle
Murloc Warleader
3 8
Old Murk-Eye
Old Murk-Eye
Coldlight Oracle
7 30
Old Murk-Eye
Bluegill Warrior
Bluegill Warrior
Murloc Warleader
Murloc Warleader
Coldlight Oracle
Coldlight Oracle
*/
 



/**************************************
	Problem id	: SDUT OJ 3569 
	User name	: 吃花的栗鼠 
	Result		: Accepted 
	Take Memory	: 492K 
	Take Time	: 10MS 
	Submit Time	: 2016-06-19 13:35:45  
**************************************/


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ACM-ICPC(国际大学生程序设计竞赛)是一项全球性的大学生程序设计比赛,每年吸引来自世界各地的顶尖大学代表队参与。ACM-ICPC竞赛的核心内容是团队编程和问题解决能力。 首先,ACM-ICPC竞赛对参赛选手的编程能力要求很高。参赛队伍需要在规定的时间内解决一系列的算法问题,这些问题常常包含复杂的数据结构和算法,要求选手在有限的时间内设计和实现高效的程序。 其次,ACM-ICPC竞赛强调团队协作。每个队伍由三名选手组成,他们需要分工合作,保持良好的沟通与协调,共同解决问题。团队成员需要相互理解、相互信任,快速地协商和决策,同时要保持高效的任务分配和时间管理。 此外,ACM-ICPC竞赛也需要选手具备良好的问题解决能力。这些问题往往是实际应用或理论推导相关的,选手需要从数学、计算机科学和算法等多个角度出发,找到最佳解决方案。在面对问题时,选手需要对问题进行分析、抽象和建模,运用各种算法和数据结构进行解决。 对于参赛选手来说,ACM-ICPC提供了一个学习与交流的平台。在比赛中,选手可以接触到不同国家和地区的优秀程序设计人才,学习他们的思维方式和编程技巧。同时,ACM-ICPC还举办了一系列的培训和研讨会,让选手有机会深入了解计算机科学和算法领域最新的研究成果。 总之,ACM-ICPC国际大学生程序设计竞赛是一个挑战性与学习性兼具的比赛。它要求选手具备扎实的编程技能、团队合作能力和问题解决能力。参与此竞赛不仅可以锻炼自己的编程能力,还能与全球的顶尖程序设计人才进行交流,拓宽自己的视野和思维方式。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值