找回密码
 注册
搜索
查看: 1627|回复: 21
收起左侧

[心得讨论] [ACM]1005 Touhou Dots

[复制链接]

该用户从未签到

11

威严

596

帖子

1万

点数

七彩门番

Rank: 5Rank: 5

积分
3315
发表于 2012-9-10 10:05:14 | 显示全部楼层 |阅读模式
1005 Touhou Dots

Description:
Touhou Dots, an interesting team confrontation map in War3, has a very complete equipment system and resist system as a map in War3.
In the game, each player has a backpack whick has 6 grids and some gold reserves. There are three kingd of equipments in the game.
1.Normal equipment: Each equipment occupies one grid in the backpack and the player can buy it directly. The value of the normal equipment is equal to its price.
2.Mixture equipment:Each equipments occupies one grid in the backpack and the player only get it through the synthesis of the corresponding recipe and it's reel. If you have enough equipment of recipes in your backpack and it's reel, you can get it. The value of the mixure equipment is equal to the sum of all equipments' value in the recipe plus the reel cost. A mixture equipment can be made from serveral normal equipments and mixure equipments.
3. Consume equipment: A kind of equipment must occupy one grid and the player can buy it directly. That is to say, if you have a number of consume equipments ,they must be in one grid. The value of each consume equipment is equal to its price, and when you want to sell this kind of equipment or use it in a synthesis, whole grid's equipments would sell/disappear. The Resist effect of cosume equipment does not stack.
You should pay attention:
1.When the backpack is full, you cannot buy anything,only in the case that use the equipment bought can synthesis an item, or it is a cosume equipment and player already have this kind of equipment.
2.When a mixture equipment is get, the mixture equipment of recipe in you backpack will disappear.
3. If one operation is illegal, there is nothing happened in your backpack and gold.
4.Initially, there is nothing in your backpack and you have 0 gold,Physical Resist and Magic Resist are 0.
5. The gold you have cannot be a negative number.

As a DS programmer, you want to simulate the dynamic states in your backpack by program. Now you have initial state and serveral operations, you wonder the player hero's Physical Resist and Magical Resist in the final state.

Input:
There are multiple test cases.
The first line contains an integer N1(0<=N1<=0) indicating the kind of normal equipment.
The next N1 lines each line contains a string and an integer indicating the name of this normal equipment and its price, PhysicalResist,and MagicalResistrespectively.
**Format: str num PhysicalResist MagicalResist
The following line contains an integer N2(0<=N2<=20) indicating the kind of mixure equipment.
Each of the next N2 lines begins with a string and an integer indicating the name of this mixure equipment and its reel cost, PhysicalResist,and MagicalResist. Following the synthesis recipe of this kind of equipment: some pairs of string and integer indicating which kind of equipment and the number you need to synthesis.
**Format: str num PhysicalResist MagicalResist: str1 num1, str2 num2,..., strn numn(num1+num2+...+numn<=6 and numi>=0 (i<=i<=n))
The next line contains an integer N3(0<=N3<=20) indicating the kind of consume equipment.
Each of the next N3 lines contains a string and an integer indicating the name of this consume equipment and it's price,Physical Resist,Magical Resist.
**Format: str num PhysicalResist MagicalResist
The next line contains an integer M(0<=M<=100) indicating the number of operation.
Each of the next M lines contains an operation.
There are three kinds of operation:
1. +num indicating you get num gold (0<=num<=100).
2. +str indicating you want to get an equipment or reel whose name is str.
3. -str indicating you want to sell the equipment or reel whose  name is str. If you sell the equipment, you can get gold that is 75% to its value.

There is a blank line after each case.
All strings of name only contain lowercase character and it's length is no more than 25. The price of the equipment is a non-negative integer which is no more than 6999.

Output:
For each case you should output only serveral lines.
The first line output "Case " + case number + ":".
The next line output the hero's Physical Resist and Magic Resist.
Note: Output a blank line after each test case.

Sample Input:
2
ring 1 1 1
sword 2 0 0
1
knife 3 2 1: ring 1, sword 1
1
telport 85 0 2
6
+100
+ring
+sword
+knife
+telport
+telport

1
shoe 0 0 0
1
GoodManCard 70 0 0:
1
telport 85 0 2
3
+80
+shoe
+GoodManCard

1
shoe 0 0 0
1
GoodManCard 70 0 0:
1
telport 85 0 2
4
+10
+shoe
+GoodManCard
-GoodManCard

1
cucumber 53 0 0
1
GoodManCard 5 0 0: cucumber 1
1
telport 85 0 2
8
+1000
+cucumber
+cucumber
+cucumber
+cucumber
+cucumber
+telport
+telport

Sample Output:
Case 1:
2 3

Case 2:
0 0

Case 3:
0 0

Case 4:
0 2

评分

参与人数 1点数 +1 收起 理由
绯色琉璃 + 1 UT吃翔!

查看全部评分

「充满魅力的四重结界」
  • TA的每日心情

    2012-8-1 18:59
  • 签到天数: 634 天

    [LV.9]以坛为家II

    7

    威严

    1995

    帖子

    2204

    点数

    七彩门番

    幻想郷の記憶

    Rank: 5Rank: 5

    积分
    3941

    永恒の无意识

    发表于 2012-9-10 10:07:15 | 显示全部楼层
    鱼头的头像太亮了,闪瞎老夫也!
    回复

    使用道具 举报

  • TA的每日心情
    无聊
    2012-7-11 17:21
  • 签到天数: 670 天

    [LV.9]以坛为家II

    11

    威严

    9182

    帖子

    2334

    点数

    八百万神明

    Rank: 7Rank: 7Rank: 7

    积分
    13229

    呆毛の毒素

    QQ
    发表于 2012-9-10 10:10:51 | 显示全部楼层
    头像太马 建议和谐
    回复

    使用道具 举报

    该用户从未签到

    41

    威严

    1438

    帖子

    6022

    点数

    版主

    Rank: 10Rank: 10Rank: 10

    积分
    7150
    发表于 2012-9-10 10:11:54 来自手机 | 显示全部楼层
    这玩意准备发到哪去?→_→
    回复

    使用道具 举报

    该用户从未签到

    4

    威严

    464

    帖子

    2215

    点数

    妖精女仆

    Rank: 3Rank: 3

    积分
    977
    发表于 2012-9-10 10:13:09 来自手机 | 显示全部楼层
    我只看到最后一堆cucumber
    回复

    使用道具 举报

    该用户从未签到

    4

    威严

    695

    帖子

    3640

    点数

    白玉楼半灵

    Rank: 4

    积分
    1488
    发表于 2012-9-10 10:14:42 来自手机 | 显示全部楼层
    不明觉厉0.0
    回复

    使用道具 举报

    该用户从未签到

    1

    威严

    68

    帖子

    943

    点数

    人形

    0.0

    Rank: 2

    积分
    225
    发表于 2012-9-10 10:15:31 来自手机 | 显示全部楼层
    小的没文化,真心看不懂
    回复

    使用道具 举报

    该用户从未签到

    1

    威严

    109

    帖子

    1090

    点数

    人形

    Rank: 2

    积分
    369
    发表于 2012-9-10 10:16:57 | 显示全部楼层
    看不懂 跪了
    回复

    使用道具 举报

    该用户从未签到

    10

    威严

    3578

    帖子

    4166

    点数

    渡河死神

    布都!!!!!!

    Rank: 6Rank: 6

    积分
    6641

    已认证触手画师

    发表于 2012-9-10 10:19:22 | 显示全部楼层
    后面那段意义不明
    回复

    使用道具 举报

    该用户从未签到

    6

    威严

    3244

    帖子

    1537

    点数

    七彩门番

    Rank: 5Rank: 5

    积分
    4999

    永恒の笨蛋永恒の蘑菇碳

    发表于 2012-9-10 10:24:00 来自手机 | 显示全部楼层
    艹我居然看懂一半!
    回复

    使用道具 举报

    该用户从未签到

    4

    威严

    1526

    帖子

    1900

    点数

    白玉楼半灵

    一直都很喜欢卖队友

    Rank: 4

    积分
    2493

    永恒の西瓜永恒の小五萝莉

    QQ
    发表于 2012-9-10 10:24:08 | 显示全部楼层
    哎哟我艹 看不懂
    回复

    使用道具 举报

    该用户从未签到

    0

    威严

    244

    帖子

    599

    点数

    禁止发言

    积分
    362
    发表于 2012-9-10 10:24:24 | 显示全部楼层
    提示: 作者被禁止或删除 内容自动屏蔽
    回复

    使用道具 举报

    该用户从未签到

    4

    威严

    298

    帖子

    2087

    点数

    妖精女仆

    Rank: 3Rank: 3

    积分
    936
    发表于 2012-9-10 10:56:11 来自手机 | 显示全部楼层
      描述:
      Touhou点,一个有趣的团队对抗地图,有一个非常War3成套设备系统和抵抗系统作为一个地图在War3。
      在游戏中,每个参与者都有一个背包搭哪有6网格和一些黄金储备。有三个kingd设备的游戏。
      1。正常的设备:每个设备占有一个网格在背包和玩家可以直接买它。正常的设备的价值等于它的价格。
      2。混合设备:每个设备占有一个网格在背包和球员只有通过相应的合成配方和它的卷。如果你有足够的设备在你的背包里的食谱和它的盘,你可以得到它。mixure设备的值等于总和所有设备的价值在配方加上卷成本。一个混合设备可以由几个正常的设备和mixure设备。
      3。消费设备:一种设备必须占用一个网格和玩家可以直接买它。也就是说,如果你有大量的消费设备,他们必须在一个网格。每个消费设备的价值等于它的价格,当你想要出售这种设备或使用它在一个合成,整个电网的设备将出售/消失。cosume的抵制效应的设备并不堆栈。
      你应该注意:
      1。当背包已经满了,你不能买任何东西,只有在使用设备的情况下购买可以合成一个项目,或这是一个cosume设备和球员已经拥有这种设备。
      2。当一个混合设备是获得,混合设备的配方在你的背包将会消失。
      3。如果一个操作是非法的,没有什么发生在你的背包和黄金。
      4。起初,没有什么在你的背包和你有0金、身体抵抗和魔法抵抗是0。
      5。黄金你不能是一个负数。
      
      作为一个DS程序员,你想模拟动态州在你的背包里的程序。现在你有初始状态和几个操作,您想知道玩家英雄的身体抵抗和魔法抵抗在最终的状态。
      
      输入:
      有多个测试用例。
      第一行包含一个整数N1(0 < = N1 < = 0)表明这种正常的设备。
      接下来的N1线每行包含一个字符串和一个整数表示这正常的名字设备,它的价格,PhysicalResist,MagicalResistrespectively。
      * *格式:str num PhysicalResist MagicalResist
      下面的行包含一个整数N2(0 < = N2 < = 20)指示的那种mixure设备。
      每个下N2行始于字符串和整数表示这mixure设备的名称及其卷成本,PhysicalResist,MagicalResist。以下的合成配方的这种设备:一些对字符串和整数表示这类设备和数字你需要合成。
      * *格式:str num PhysicalResist MagicalResist:str1 num1,str2 num2,……,strn numn(num1 + num2 +…+ numn < = 6和numi > = 0(我< =我< = n))
      下一行包含一个整数N3(0 < = N3 < = 20)指示的那种消费设备。
      接下来的每一行包含一个字符串和N3整数表示这个地方的名字和它的消费设备价格,身体抵抗,神奇的抵制。
      * *格式:str num PhysicalResist MagicalResist
      下一行包含一个整数M(0 < = M < = 100)指示操作的数量。
      每个接下来M行包含一个操作。
      有三种操作:
      1。+ num指示你得到num黄金(0 < = num < = 100)。
      2。+ str表明你希望得到一个设备或卷,他的名字叫str。
      3。str指示你想卖设备或卷,他的名字叫str。如果你卖设备,你可以得到黄金,是75%,它的价值。
      
      有一个空行之后的每一个案例。
      所有字符串的名称只包含小写字符和它的长度不超过25。设备的价格是一个非负整数是不超过6999。
      
      输出:
      对于每种情况下你应该输出只有几个线。
      第一行输出“案例”+箱号+ ":"。
      下一行输出英雄的身体抵抗和马
    回复

    使用道具 举报

    该用户从未签到

    4

    威严

    298

    帖子

    2087

    点数

    妖精女仆

    Rank: 3Rank: 3

    积分
    936
    发表于 2012-9-10 10:57:52 来自手机 | 显示全部楼层
    以上来自手机词典,其实鱼头原文我也看不懂
    回复

    使用道具 举报

    该用户从未签到

    1

    威严

    187

    帖子

    907

    点数

    人形

    愉♂悦

    Rank: 2

    积分
    466
    发表于 2012-9-10 11:07:42 | 显示全部楼层
    头像太马,英文苦手
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    手机版|Archiver| ( ICP15046467-1 )

    GMT+8, 2024-5-11 00:54 , Processed in 0.068609 second(s), 27 queries .