2.11题目翻译

https://acs.jxnu.edu.cn/problem/HDU1317

It has recently been discovered how to run open-source software on the Y-Crate gaming device. A number of enterprising designers have developed Advent-style games for deployment on the Y-Crate. Your job is to test a number of these designs to see which are winnable. 
Each game consists of a set of up to 100 rooms. One of the rooms is the start and one of the rooms is the finish. Each room has an energy value between -100 and +100. One-way doorways interconnect pairs of rooms. 

The player begins in the start room with 100 energy points. She may pass through any doorway that connects the room she is in to another room, thus entering the other room. The energy value of this room is added to the player's energy. This process continues until she wins by entering the finish room or dies by running out of energy (or quits in frustration). During her adventure the player may enter the same room several times, receiving its energy each time. 

输入:

The input consists of several test cases. Each test case begins with n, the number of rooms. The rooms are numbered from 1 (the start room) to n (the finish room). Input for the n rooms follows. The input for each room consists of one or more lines containing: 

the energy value for room i 
the number of doorways leaving room i 
a list of the rooms that are reachable by the doorways leaving room i 
The start and finish rooms will always have enery level 0. A line containing -1 follows the last test case. 

输出:

In one line for each case, output "winnable" if it is possible for the player to win, otherwise output "hopeless". 

最近,人们发现了如何在Y-Crate游戏设备上运行开源软件。许多设计师已经开发了Advent风格的游戏来部署在Y-Crate上。你的任务是测试这些设计,看看哪些是可以赢的。每个游戏由多达100个房间组成。其中一个房间是开始,其中一个房间是结束。每个房间都有一个能量值在-100和100+00之间。单向的门道相互连接着成对的房间。玩家从开始室开始,获得100个能量点。可以通过任何连接房间的门进入另一个房间,从而进入另一个房间。这个房间的能量价值被添加到玩家的能量中。这个过程一直持续到,直到她进入结束室或死于奔跑精力不足(或在沮丧中放弃)。在她的冒险过程中,玩家可以多次进入同一个房间,每次都接受它的能量。

输入:

该输入由几个测试用例组成。每个测试用例都以n开头,即房间的数量。房间的编号从1(起始室)到n(结束室)。下面是n个房间的输入信息。每个房间的输入由一条或多行组成,包括:房间i的能量值i离开房间的门口的数量i一个离开房间i的门口可到达的房间的列表开始和结束的房间总是有能量0级。包含-1的行遵循最后一个测试用例。

输出:

在每种情况下的一行中,如果玩家有可能赢,则输出为“可赢的”,否则输出为“无望的”。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值