#include<cstdio>
typedef struct
{
int attack,health;
} cus; cus info[][];
int aliv[];
int player = ; void summon();
void attack();
void solven();
void del(int,int);
//void init(); int main()
{
int n=;
char order[];
//init();
scanf("%d",&n);
info[][].health = ;
info[][].health = ;
while(n--)
{
scanf("%s",order);
if(order[] == 'e')
player = !player;
else if(order[] == 's')
summon();
else if(order[] == 'a')
attack();
}
solven();
} void summon()
{
int p,a,h;
scanf("%d%d%d",&p,&a,&h);
++aliv[player];
for(int i=aliv[player]; i>p; --i)
{
info[player][i].attack = info[player][i-].attack;
info[player][i].health = info[player][i-].health;
}
info[player][p].attack = a;
info[player][p].health = h;
//init();
} void attack()
{
int p1,p2;
scanf("%d%d",&p1,&p2);
if(p2 != )
{
info[player][p1].health -= info[(!player)][p2].attack;
info[(!player)][p2].health -= info[player][p1].attack;
if(info[player][p1].health < )
del(player,p1);
if(info[(!player)][p2].health <)
del((!player),p2);
}
else
info[(!player)][p2].health -= info[player][p1].attack;
//init();
} void solven()
{
//init();
int num;
if(info[][].health < && info[][].health > )
printf("-1\n");
else if(info[][].health < && info[][].health > )
printf("1\n");
else
printf("0\n"); printf("%d\n%d",info[][].health,aliv[]);
for(int i=; i<=aliv[]; ++i)
printf(" %d",info[][i].health);
printf("\n"); printf("%d\n%d",info[][].health,aliv[]);
for(int i=; i<=aliv[]; ++i)
printf(" %d",info[][i].health);
printf("\n");
} void del(int x,int p)
{
for(int i=p; i<aliv[x]; ++i)
{
info[x][i].attack = info[x][i+].attack;
info[x][i].health = info[x][i+].health;
}
info[x][aliv[x]].attack = ;
info[x][aliv[x]].health = ;
--aliv[x];
} /*void init()
{
puts("\n*************************");
puts("player1's attack:");
for(int i=0; i<8; ++i)
printf("%d ",info[0][i].attack);
puts(""); puts("player1's health:");
for(int i=0; i<8; ++i)
printf("%d ",info[0][i].health);
puts(""); puts("player2's attack:");
for(int i=0; i<8; ++i)
printf("%d ",info[1][i].attack);
puts(""); puts("player2's health:");
for(int i=0; i<8; ++i)
printf("%d ",info[1][i].health);
puts("");
puts("*************************\n");
}*/

CCF-炉石传说的更多相关文章

  1. CCF 炉石传说(模拟)

    试题编号: 201612-3 试题名称: 炉石传说 时间限制: 1.0s 内存限制: 256.0MB 问题描述 <炉石传说:魔兽英雄传>(Hearthstone: Heroes of Wa ...

  2. CCF CSP 201609-3 炉石传说

    CCF计算机职业资格认证考试题解系列文章为meelo原创,请务必以链接形式注明本文地址 CCF CSP 201609-3 炉石传说 问题描述 <炉石传说:魔兽英雄传>(Hearthston ...

  3. [原创]webapp/css3实战,制作一个《炉石传说》宣传页

    在移动网页,尤其是webapp中常需要用到大量的css3动画,来获得良好交互体验 我之前帮朋友做了一个,可惜没帮上忙现在和大家分享一下 目标是要做一个<炉石传说>游戏的介绍宣传页面,文字内 ...

  4. 炉石传说 C# 开发笔记(6月底小结)

    炉石传说的开发,已经有30个工作日了. 关于法术的定义方法,有过一次重大的变更:法术效果是整个炉石的核心,正是因为丰富的法术效果,才造就了炉石的可玩性. 原来构思的时候,对于法术效果没有充分的理解,所 ...

  5. 炉石传说 C# 开发笔记 (续)

    炉石传说山寨的工作一直在进行着,在开发过程中深深体会到,对于业务的理解和整个程序的架构的整理远比开发难得多. 在开发过程中,如果你的模型不合理,不准确,很有可能造成代码的混乱,冗余,难以维护和扩展性比 ...

  6. 炉石传说 C# 开发笔记

    最近在大连的同事强力推荐我玩 炉石传说,一个卡牌游戏.加上五一放一个很长很长的假期,为了磨练自己,决定尝试开发一个C#的炉石传说. 这件事情有人已经干过了,开发了一个网页版的炉石,但是貌似不能玩... ...

  7. 炉石传说__multiset

     炉石传说  Problem Description GG学长虽然并不打炉石传说,但是由于题面需要他便学会了打炉石传说.但是传统的炉石传说对于刚入门的GG学长来说有点复杂,所以他决定自己开发一个简化版 ...

  8. 《炉石传说》建筑设计欣赏(6):卡&amp;在执行数据时,组织能力

    上一篇文章我们看到了<炉石传说>核心存储卡的数据,今天,我们不断探索卡&身手. 基本的类 通过之前的分析,卡牌&技能涉及到几个类体系:Entity.Actor.Card.S ...

  9. fzu Problem - 2232 炉石传说(二分匹配)

    题目链接:http://acm.fzu.edu.cn/problem.php?pid=2232 Description GG学长虽然并不打炉石传说,但是由于题面需要他便学会了打炉石传说.但是传统的炉石 ...

  10. islands打炉石传说<DP>

    islands最近在完一款游戏"炉石传说",又名"魔兽英雄传".炉石传说是一款卡牌类对战的游戏.游戏是2人对战,总的来说,里面的卡牌分成2类,一类是法术牌,另一 ...

随机推荐

  1. ?:,reverse,vector的基本小结

    #include <cstdio> //此代码为网上所复制 #include <iostream> #include <string> #include <s ...

  2. laravel 多检索条件列表查询

    public function indexQuestions(Request $request, ResponseFactoryContract $response, QuestionModel $q ...

  3. android开发默认图标怎么换?

    首先要在资源文件放入想换的图标图片拖到drawable-XX文件夹下, 然后打开AndroidManifest.xml这个配置清单文件找 到application标签里的这句android:icon= ...

  4. C#获取一周的工作日显示(星期几)

    代码如下: gridBandW1.Caption = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName ...

  5. MySQL Windows 下的安装

    my.ini ####################配置文件开始################### # For advice on how to change settings please s ...

  6. [转] history.back()和history.go()的区别

    Javascript:history.go()和history.back()的用法和区别 go(-1): 返回上一页,原页面表单中的内容会丢失:history.go(-1):后退+刷新:history ...

  7. Java集合源码学习(二)ArrayList

    1.关于ArrayList ArrayList直接继承AbstractList,实现了List. RandomAccess.Cloneable.Serializable接口,为什么叫"Arr ...

  8. Asp.Net Mvc 返回类型总结

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  9. Python_部分内置函数

    内置函数:可以直接调用的函数 all():传入的列表,元组,等等,只要一个为假,就为假(fales)(所有的都为真才为真) # None, {}:空字典, []:空列表, 0:零,():空集合,“”: ...

  10. Kudu Native RDD

    Spark与Kudu的集成同事提供了kudu RDD import org.apache.kudu.spark.kudu.KuduContext import org.apache.spark.{Sp ...